Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
204
template<typename T>
205
inline PyObject* CastToPyObject(T&& t) {
206
return py::cast(t).inc_ref().ptr();
207
}
208
209
template<>
210
inline PyObject* CastToPyObject<Maybe<Tensor>>(Maybe<Tensor>&& t) {
Callers
15
ndarray_judgment_and_compatibility
Function · 0.85
PyTensorObject_get_device
Function · 0.85
PyTensorObject_new
Function · 0.85
PyTensorObject_global_id
Function · 0.85
PyTensorObject_data_ptr
Function · 0.85
PyTensorObject_ndim
Function · 0.85
PyTensorObject_shape
Function · 0.85
PyTensorObject_dtype
Function · 0.85
PyTensorObject_is_cpu
Function · 0.85
PyTensorObject_is_cuda
Function · 0.85
PyTensorObject_ref_index
Function · 0.85
PyTensorObject_grad_fn
Function · 0.85
Calls
2
cast
Function · 0.85
ptr
Method · 0.45
Tested by
no test coverage detected