-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
good first issuelow priorityWe're unlikely to get around to doing this in the near futureWe're unlikely to get around to doing this in the near futuremodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🚀 Feature
Add nbytes and itemsize methods to Tensor. It has the same semantics as https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ndarray.nbytes.html and https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ndarray.itemsize.html (though, in keeping with PyTorch style, it is a function call, not a property).
Motivation
The primary motivation is that caffe2::Tensor has these two methods, it's used somewhat frequently in the Caffe2 codebase, and it seems like a generally useful thing to have around.
Alternatives
- Don't add them, and make users do the computation themselves. This might be a little annoying to do, because if we don't have
itemsize()the user has to compute it themselves from the dtype.
Metadata
Metadata
Assignees
Labels
good first issuelow priorityWe're unlikely to get around to doing this in the near futureWe're unlikely to get around to doing this in the near futuremodule: numpyRelated to numpy support, and also numpy compatibility of our operatorsRelated to numpy support, and also numpy compatibility of our operatorstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module