Add nbytes, itemsize, element_size to at::Tensor. (#17810)
authorEdward Yang <ezyang@fb.com>
Tue, 12 Mar 2019 16:45:06 +0000 (09:45 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 12 Mar 2019 16:48:54 +0000 (09:48 -0700)
commit18949c8e007214bbd838546b231c4df5dcbbe353
treee33842692815b2d44d3a1eef2274c42313a97e57
parentdc4cbd95652fad34a9e9a0b1b288d04072900a9f
Add nbytes, itemsize, element_size to at::Tensor. (#17810)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17810

Partially addresses #12728. Also, switch the element_size bindings
to use the new function, rather than the method on Type.

We don't add Python bindings yet, as they need to be special
(they will be properties.)

Differential Revision: D14388790

fbshipit-source-id: 294183d0c8a59b0c13f2bf21d6f1cd557333e83b
aten/src/ATen/core/Tensor.h
aten/src/ATen/templates/Tensor.h
tools/autograd/templates/python_variable_methods.cpp