It would be reasonable to error out at `x + y` due to unclear broadcasting expectations. It would also be reasonable to broadcast the (32,) vector to (32, 1). But how about a third, insane option?
-
-
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Using http://np.dot/np.matmul on multidimensional arrays can also lead to unexpected results AND runtimes:https://github.com/numpy/numpy/issues/8957 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This is one case when people realize why providing proper dimensions is crucial
-
Yes and it starts with never using Rank 1 array, they are too ambiguous
- Show replies
New conversation -
-
-
It gets really fun when z is so big that you have to kill your jupyter notebook kernel and start over
-
Now, this part makes me cry...
End of conversation
New conversation -
-
-
wow i'm really not feeling this output; much rather prefer error due to unclear broadcasting.
@tarun_bod check this outThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
The real underlying problem IMHO is that all these broadcast rules are determined at runtime. Maybe it's not "pythonic" but I'd really really like some deterministic way for my editor to predict the dimensions of my tensors.
-
This and integer division caused me countless hours of horror.
End of conversation
New conversation -
-
-
I feel like numpy is just too permissive in many cases where it should be throwing errors. I like that in Julia these kinds of operations are are more strongly typed such that you're much less likely to fall into this kind of problem.
-
What they did in Julia was to introduce broadcasting operators (prefix the operator with a '.' if you want it to broadcast). Didn't like it at first, but now I tend to like having to be explicit about broadcasting vs non- broadcasting.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.