torch.Tensor.data_ptr#
- Tensor.data_ptr() int#
Returns the address of the first element of
selftensor.Note
If the tensor is a copy-on-write tensor (e.g. created via
_lazy_clone()), calling this method will materialize the copy. Useconst_data_ptr()if you only need read-only access to the data pointer.