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

Function Any_AnyView_GetFloat

examples/abi_overview/example_code.c:99–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99double Any_AnyView_GetFloat(const TVMFFIAny* any) {
100 if (any->type_index == kTVMFFIInt || any->type_index == kTVMFFIBool) {
101 return (double)(any->v_int64);
102 } else if (any->type_index == kTVMFFIFloat) {
103 return any->v_float64;
104 }
105 assert(0); // FAILED to read float
106 return 0.0;
107}
108// [Any_AnyView.GetInt_Float.end]
109
110// [Any_AnyView.GetDLTensor.begin]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected