-
Notifications
You must be signed in to change notification settings - Fork 74k
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
[feature request] disable harmful broadcast #1406
Comments
|
Thanks. I guess the second is impossible. so closing. |
Nothing is impossible, it would just take a lot of work to plumb that through everywhere, to set the option globally, and for everything to work as well without broadcasting. For example, when computing gradients, automatic broadcasting is quite useful to simplify gradient expressions, particularly when the shapes are unknown at construction time. I've seen similar requests made for numpy, and it sounds like higher level libraries typically provide the 'safety' for those users who want it. However, I'm open to the idea if it can be done in a nice way. |
I have spent 8 hours on exactly this bug. An option to disable broadcasting globally or raising a warning, etc. would be very nice. |
Just ran into a bug which would also have been prevented by warning on broadcasting. A |
Broadcast may lead to hidden bugs. For example, the following code,
When
logits
is of the shape(200,1)
and they
is of the shape(200,)
, the xent becomes(200, 200)
, which is wrong. What's worse, thereduce_mean
will hide this problem by reducing everything into a scalar.Request,
sigmoid_cross_entropy_with_logits
The text was updated successfully, but these errors were encountered: