Skip to content

Commit 53836c5

Browse files
committed
_infinicore.Tensor 加入 dtype
1 parent e03b56a commit 53836c5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/infinicore/pybind11/tensor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ inline void bind(py::module &m) {
1414
.def_property_readonly("shape", [](const Tensor &tensor) { return tensor->shape(); })
1515
.def_property_readonly("strides", [](const Tensor &tensor) { return tensor->device(); })
1616
.def_property_readonly("ndim", [](const Tensor &tensor) { return tensor->ndim(); })
17+
.def_property_readonly("dtype", [](const Tensor &tensor) { return tensor->dtype(); })
1718

1819
.def("data_ptr", [](const Tensor &tensor) { return tensor->data(); })
1920
.def("size", [](const Tensor &tensor, std::size_t dim) { return tensor->size(dim); })

0 commit comments

Comments
 (0)