Skip to content

Commit

Permalink
Expose Tensor.setRawData in Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
iceychris committed Mar 23, 2024
1 parent 51b05fe commit 25506e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ PYBIND11_MODULE(kp, m)
.def("tensor_type", &kp::Tensor::tensorType, DOC(kp, Tensor, tensorType))
.def("data_type", &kp::Tensor::dataType, DOC(kp, Tensor, dataType))
.def("is_init", &kp::Tensor::isInit, DOC(kp, Tensor, isInit))
.def("destroy", &kp::Tensor::destroy, DOC(kp, Tensor, destroy));
.def("destroy", &kp::Tensor::destroy, DOC(kp, Tensor, destroy))
.def("set_raw_data", [](kp::Tensor& self, py::buffer b) {
py::buffer_info info = b.request();
self.setRawData(info.ptr);
}, DOC(kp, Tensor, setRawData));

py::class_<kp::Sequence, std::shared_ptr<kp::Sequence>>(m, "Sequence")
.def(
Expand Down

0 comments on commit 25506e7

Please sign in to comment.