MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Any_AnyView_GetDLTensor

Function Any_AnyView_GetDLTensor

examples/abi_overview/example_code.c:111–119  ·  view source on GitHub ↗

[Any_AnyView.GetDLTensor.begin]

Source from the content-addressed store, hash-verified

109
110// [Any_AnyView.GetDLTensor.begin]
111DLTensor* Any_AnyView_GetDLTensor(const TVMFFIAny* value) {
112 if (value->type_index == kTVMFFIDLTensorPtr) {
113 return (DLTensor*)(value->v_ptr);
114 } else if (value->type_index == kTVMFFITensor) {
115 return (DLTensor*)((char*)(value->v_obj) + sizeof(TVMFFIObject));
116 }
117 assert(0); // FAILED to read DLTensor
118 return NULL;
119}
120// [Any_AnyView.GetDLTensor.end]
121
122// [Any_AnyView.GetObject.begin]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected