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

Function FFIConvertFromAnyViewToObjectRef

include/tvm/ffi/reflection/creator.h:105–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 */
104template <typename TObjectRef>
105TObjectRef FFIConvertFromAnyViewToObjectRef(AnyView input) {
106 TVMFFIAny input_pod = input.CopyToTVMFFIAny();
107 if (auto opt = TypeTraits<TObjectRef>::TryCastFromAnyView(&input_pod)) {
108 return *std::move(opt);
109 }
110 TVM_FFI_THROW(TypeError) << "Cannot cast from `" << TypeIndexToTypeKey(input_pod.type_index)
111 << "` to `" << TypeTraits<TObjectRef>::TypeStr() << "`";
112}
113
114} // namespace details
115

Callers

nothing calls this directly

Calls 2

TypeIndexToTypeKeyFunction · 0.85
CopyToTVMFFIAnyMethod · 0.80

Tested by

no test coverage detected