-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Add "ndim" property to tensor #20565
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
|
Is |
|
@ssnl Yes |
colesbury
left a comment
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.
Needs some minimal testing, otherwise looks good.
We should also figure out a strategy for documentation for the new NumPy properties, functions, and kwargs. I think that Tensor properties (ndim, .T) are important enough to be documented directly in the Tensor documentation (tensors.rst). The kwarg aliases can probably go in a separate "NumPy" compatibility section
facebook-github-bot
left a comment
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.
@umanwizard has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Do we have a plan for |
|
@fmassa I don't have any better answer than "we need to think more about what to do in those cases". So in the immediate future I'm not planning on changing anything related to |
torch/_tensor_docs.py
Outdated
|
|
||
| add_docstr_all('ndim', | ||
| r""" | ||
| Is the number of dimensions in this Tensor. |
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.
can we just document it the same as ndimension?
facebook-github-bot
left a comment
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.
@umanwizard has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@umanwizard merged this pull request in 987f1cc. |
For compatibility with numpy.