Function tvm::ffi::CreateEmptyObject

Function tvm::ffi::CreateEmptyObject#

Function Documentation#

inline ObjectPtr<Object> tvm::ffi::CreateEmptyObject(const TVMFFITypeInfo *type_info)#

Create an empty object via the type’s native creator or __ffi_new__ type attr.

Falls back to the __ffi_new__ type attribute (used by Python-defined types) when the native metadata->creator is NULL.

Parameters:

type_info – The type info for the object to create.

Throws:

RuntimeError – if neither creator nor ffi_new is available.

Returns:

An owned ObjectPtr to the newly allocated (zero-initialized) object.