-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make type check utilities #95
Conversation
return info | ||
|
||
|
||
def get_type(name, index, array, accept_none): |
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.
If get_type
is not called only from get_types, I think get_type
should be in get_types
to narrow its scope.
In offline discussion, we decided to use this style:
|
def check_type_forward(self, in_types): | ||
type_check.expect(in_types.size() > 0) | ||
type_check.expect(in_types[0].ndim > | ||
type_check.IntVariable(self.axis, 'axis')) |
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.
Can I write in_types[0].ndim.eval > self.axis
instead? I think it is better because value of the left hand side is used afterwards as ndim
.
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.
By offline discussion, I found that it is necessary to wrap self.axis
in order to print variable name axis
when this expectation failed.
BinaryOperator.__init__(self, priority, lhs, rhs, exp, func) | ||
|
||
|
||
class Bool(object): |
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.
Bool
is misunderstanding with bool
(True
or False
)
LGTM 👍 |
Implement slogdet
Function
. The function is called with expression treesfixes #1
For example, when 4th dimension of 1st argument of an input is expected to be 2, you can write like this:
And, actually it is 1, a user can get a error message like this: