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

Method FromTyped

include/tvm/ffi/function.h:536–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534 */
535 template <typename TCallable>
536 static Function FromTyped(TCallable&& callable) {
537 using FuncInfo = details::FunctionInfo<std::decay_t<TCallable>>;
538 // Callable is always captured by value here to avoid possible dangling reference
539 auto call_packed = [callable = std::forward<TCallable>(callable)](
540 const AnyView* args, int32_t num_args, Any* rv) mutable -> void {
541 details::unpack_call<typename FuncInfo::RetType>(
542 std::make_index_sequence<FuncInfo::num_args>{}, nullptr, callable, args, num_args, rv);
543 };
544 return FromPackedInternal(std::move(call_packed));
545 }
546 /*!
547 * \brief Constructing a packed function from a normal function.
548 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected