Skip to content
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

Addition isn't commutative (if dimensions are ordered) #56

Open
zou3519 opened this issue Feb 8, 2019 · 1 comment
Open

Addition isn't commutative (if dimensions are ordered) #56

zou3519 opened this issue Feb 8, 2019 · 1 comment

Comments

@zou3519
Copy link

zou3519 commented Feb 8, 2019

It feels a little weird, but I guess it is fine if the dimensions aren't supposed to be ordered

y = ntorch.randn(1, 1, 1, 1, names=['n', 'c', 'h', 'w'])
x = ntorch.randn(1, 1, names=['h', 'c'])

(x + y).shape
OrderedDict([('n', 1), ('w', 1), ('h', 1), ('c', 1)])

(y + x).shape
OrderedDict([('n', 1), ('c', 1), ('h', 1), ('w', 1)])
@srush
Copy link
Contributor

srush commented Feb 8, 2019

Yes, we've been debating this point. The current aggressive proposal is to change shape to not be an ordereddict at all, and remove the transpose function or have it return a non-named tensor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants