You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Empty tensors are valid in ML. If the input tensor shape contains zeros, then it's correct for newShape to contain zeros. Indeed, if the input shape contains zeros, then newShapemust have at least one zero, because otherwise that would be an error. It's only an error if the number of total input element count differs from the total output element count, and so it's good to remove this redundant clause because the element count check is both necessary and sufficient.
oldShape
newShape
validity
[1,2,3]
[1,2,3]
✅
[2,3,1]
[3,2,1]
✅
[1,2,3]
[6]
✅
[0,0,0]
[0,0,0]
✅
[1,2,0]
[0,0,0]
✅
[1,2,0]
[0,2,1]
✅
[1,2,3]
[1,0,3]
❌
[1,0,3]
[1,2,3]
❌
The text was updated successfully, but these errors were encountered:
Originally posted by @fdwr in #446 (comment)
Empty tensors are valid in ML. If the
input
tensor shape contains zeros, then it's correct fornewShape
to contain zeros. Indeed, if theinput
shape contains zeros, thennewShape
must have at least one zero, because otherwise that would be an error. It's only an error if the number of total input element count differs from the total output element count, and so it's good to remove this redundant clause because the element count check is both necessary and sufficient.The text was updated successfully, but these errors were encountered: