| 51 | |
| 52 | template <typename T> |
| 53 | auto def_rendezvous(py::object m, const char* name) { |
| 54 | return py::class_<Rendezvous<T>, std::shared_ptr<Rendezvous<T>>>(m, name) |
| 55 | .def(py::init([]() { return Rendezvous<T>::make(); })) |
| 56 | .def("set", [](Rendezvous<T>& r, T v) { r.set(std::move(v)); }) |
| 57 | .def( |
| 58 | "get", [](Rendezvous<T>& r) { return r.get(); }, |
| 59 | py::call_guard<py::gil_scoped_release>()) |
| 60 | .def("drop", &Rendezvous<T>::drop) |
| 61 | .def("reset", &Rendezvous<T>::reset) |
| 62 | .def("set_exception", [](Rendezvous<T>& r, std::string&& message) { |
| 63 | r.set_exception(std::make_exception_ptr( |
| 64 | std::runtime_error(std::move(message)))); |
| 65 | }); |
| 66 | } |
| 67 | |
| 68 | using TensorAttr = LogicalTensorDesc; |
| 69 | using HostNDWithEvent = std::pair<HostTensorND, std::shared_ptr<CompNode::Event>>; |
nothing calls this directly
no test coverage detected