| 103 | */ |
| 104 | template <typename TObjectRef> |
| 105 | TObjectRef 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 |
nothing calls this directly
no test coverage detected