torch.Tensor.const_data_ptr
- Tensor.const_data_ptr() → int
Returns the address of the first element of
selftensor.Unlike
data_ptr(), this is guaranteed to be a read-only access that will not trigger copy-on-write materialization. For regular (non-COW) tensors, the return value is identical to .