Skip to content

Commit

Permalink
Define capsule as Any type to fix pybind11-stubgen error.
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Aug 31, 2024
1 parent 2514991 commit 4d3fca4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp/pybind/core/tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void pybind_core_tensor_declarations(py::module& m) {
py::class_<Tensor> tensor(
m, "Tensor",
"A Tensor is a view of a data Blob with shape, stride, data_ptr.");
m.attr("capsule") = py::module_::import("typing").attr("Any");
}
void pybind_core_tensor_definitions(py::module& m) {
auto tensor = static_cast<py::class_<Tensor>>(m.attr("Tensor"));
Expand Down

0 comments on commit 4d3fca4

Please sign in to comment.