-
Notifications
You must be signed in to change notification settings - Fork 57
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
Update chainer version 4.0.0rc1 / 3.5 #223
Conversation
chainermn/links/n_step_rnn.py
Outdated
|
||
else: # expect Chainer >4.0.0b3 | ||
check_lstm = issubclass( | ||
link.__class__, lconn.n_step_rnn.NStepRNNBase) |
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.
Isn't it more natural to use isinstance(link, lconn.n_step_rnn.NStepRNNBase)
?
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.
I'm not confident, but I guess it's safer to use issubclass
. Do you think we can assume link
is a direct instance of NStepRNNBase
?
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.
isinstance
returns True
for instances of sub classes.
In [1]: class A(): pass
In [2]: class B(A): pass
In [3]: a = A()
In [4]: b = B()
In [5]: isinstance(a, A)
Out[5]: True
In [6]: isinstance(b, A)
Out[6]: True
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.
I see, thanks. I will fix this.
This PR replaces #220 and #222 (with further version update).
The two pull requests have a circular dependency and must be fixed together.