-
Notifications
You must be signed in to change notification settings - Fork 661
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
Fix one_hot api limit #5927
Fix one_hot api limit #5927
Conversation
这个是修复谢暄说的wide and deep 不收敛的问题吗? |
不是的,这个是在 nn.Graph 里面不能调用 one_hot 的问题。 |
修复的是nn.Graph下使用one_hot的问题 |
CI failed, removing label automerge |
python/oneflow/nn/modules/one_hot.py
Outdated
if num_classes == -1: | ||
num_classes = (flow.max(input) + 1).numpy() | ||
|
||
if num_classes is 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 num_classes == -1
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 代表参数 optional 的语义
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.
我看了 torch.nn.functional.one_hot,它这就是 -1 代表需要从 input 求值,改为与它对齐
CI failed, removing label automerge |
Speed stats:
|
No description provided.