-
Notifications
You must be signed in to change notification settings - Fork 207
Add sigil for tensors #498
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
Conversation
nx/test/nx_test.exs
Outdated
3 | ||
4] == Nx.tensor([[1], [2], [3], [4]]) | ||
assert ~M[1.0 2 3 | ||
11 12 13] == Nx.tensor([[1.0, 2, 3], [11, 12, 13]]) |
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.
Please don't forget to format this file. :)
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.
That's how it looks after running mix formatter
, I double-checked :)
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.
Interesting. It may be a formatter bug. :)
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.
The implementation looks great! I have dropped only some minor comments. :)
💚 💙 💜 💛 ❤️ |
This PR adds
~M[]
sigil that evaluates to#Nx.Tensor<>
as discussed in #358, but with type in the modifier.I've added conditional compilation since support for digits in sigils was just merged to Elixir (elixir-lang/elixir#11283).