MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / TensorWeakRef

Class TensorWeakRef

imperative/python/src/tensor.cpp:824–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824struct TensorWeakRef {
825 ValueWeakRef data;
826
827 TensorWeakRef(const TensorWrapper& tw) : data(tw.m_tensor->data()) {}
828
829 py::object operator()() {
830 if (auto p = data.lock()) {
831 return TensorWrapper::make(py_tensor_type, p);
832 }
833 return py::none();
834 }
835};
836
837#ifdef METH_FASTCALL
838#define MGE_PY_INTERFACE(NAME, FUNC) \

Callers 1

fFunction · 0.85

Calls

no outgoing calls

Tested by 1

fFunction · 0.68