-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Lang] Make tensor indicing automatically cast to int32 and raise an warning #1453
[Lang] Make tensor indicing automatically cast to int32 and raise an warning #1453
Conversation
c5adefe
to
513dd52
Compare
stmt->name(), stmt->ptr->ret_data_type_name(), | ||
old_data->ret_data_type_name(), stmt->id); | ||
fmt::print(stmt->tb); | ||
TI_WARN("\n{}", stmt->tb); |
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 change them as OFT, so that users don't see them when log_level is 'error'.
This comment has been minimized.
This comment has been minimized.
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.
LGTM!
|
||
func() | ||
|
||
assert a[6, 3] == 233 |
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.
Is it guaranteed that int32(6.66) == 6
on all platforms?
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.
Yes, that's how a Python int
does, and I believe backends should follow that too.
Related issue = close #1360
[Click here for the format server]
IIUC the index to tensor should always be int32 no matter what default_ip is?