MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / CastToPyObject

Function CastToPyObject

oneflow/api/python/functional/common.h:205–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204template<typename T>
205inline PyObject* CastToPyObject(T&& t) {
206 return py::cast(t).inc_ref().ptr();
207}
208
209template<>
210inline PyObject* CastToPyObject<Maybe<Tensor>>(Maybe<Tensor>&& t) {

Callers 15

PyTensorObject_newFunction · 0.85
PyTensorObject_global_idFunction · 0.85
PyTensorObject_data_ptrFunction · 0.85
PyTensorObject_ndimFunction · 0.85
PyTensorObject_shapeFunction · 0.85
PyTensorObject_dtypeFunction · 0.85
PyTensorObject_is_cpuFunction · 0.85
PyTensorObject_is_cudaFunction · 0.85
PyTensorObject_ref_indexFunction · 0.85
PyTensorObject_grad_fnFunction · 0.85

Calls 2

castFunction · 0.85
ptrMethod · 0.45

Tested by

no test coverage detected