We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
_infinicore.Tensor
dtype
1 parent e03b56a commit 53836c5Copy full SHA for 53836c5
1 file changed
src/infinicore/pybind11/tensor.hpp
@@ -14,6 +14,7 @@ inline void bind(py::module &m) {
14
.def_property_readonly("shape", [](const Tensor &tensor) { return tensor->shape(); })
15
.def_property_readonly("strides", [](const Tensor &tensor) { return tensor->device(); })
16
.def_property_readonly("ndim", [](const Tensor &tensor) { return tensor->ndim(); })
17
+ .def_property_readonly("dtype", [](const Tensor &tensor) { return tensor->dtype(); })
18
19
.def("data_ptr", [](const Tensor &tensor) { return tensor->data(); })
20
.def("size", [](const Tensor &tensor, std::size_t dim) { return tensor->size(dim); })
0 commit comments