-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
转换规则 No.48 RNNBase #134
转换规则 No.48 RNNBase #134
Conversation
Thanks for your contribution! |
74c3298
to
d50ea32
Compare
请解决下冲突 |
if "nonlinearity" in kwargs: | ||
kwargs["activation"] = kwargs.pop("nonlinearity") | ||
|
||
if "mode" in kwargs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
除了这两个判断:
1.判断mode是否为LSTM、GRU
2.判断bidirectional=True
其他地方我觉得都可以用GenericMatcher来实现,分别通过unsupport_args、kwargs_change的json配置就可以,包括bias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处理了 batch_first
,mode
和 bidirectional
三个参数。有个尚存的问题就是,如果 mode
指定为变量,如
import torch
import torch.nn as nn
mode = "LSTM"
model = torch.nn.RNNBase(mode, 16, 32, bidirectional=False)
就会无法识别,只能处理常量。其他两个量是 boolean
所以可能影响不大,但是这个是字符串,因此可能会有更大的出错可能性。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯先这么写吧,后面我们会针对这个API支持其他两种常量 'RNN_TANH', 'RNN_RELU
if "nonlinearity" in kwargs: | ||
kwargs["activation"] = kwargs.pop("nonlinearity") | ||
|
||
if "mode" in kwargs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯先这么写吧,后面我们会针对这个API支持其他两种常量 'RNN_TANH', 'RNN_RELU
PR Docs
PR APIs