File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def ndim(self):
3232 return self ._underlying .ndim
3333
3434 def data_ptr (self ):
35- return self ._underlying .data_ptr
35+ return self ._underlying .data_ptr ()
3636
3737 def size (self , dim = None ):
3838 if dim is None :
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ inline void bind(py::module &m) {
1717 .def_property_readonly (" dtype" , [](const Tensor &tensor) { return tensor->dtype (); })
1818 .def_property_readonly (" device" , [](const Tensor &tensor) { return tensor->device (); })
1919
20- .def (" data_ptr" , [](const Tensor &tensor) { return tensor->data (); })
20+ .def (" data_ptr" , [](const Tensor &tensor) { return reinterpret_cast <std:: uintptr_t >( tensor->data () ); })
2121 .def (" size" , [](const Tensor &tensor, std::size_t dim) { return tensor->size (dim); })
2222 .def (" stride" , [](const Tensor &tensor, std::size_t dim) { return tensor->stride (dim); })
2323 .def (" numel" , [](const Tensor &tensor) { return tensor->numel (); })
You can’t perform that action at this time.
0 commit comments