Function tvm::ffi::reflection::SetFieldToDefault

Function tvm::ffi::reflection::SetFieldToDefault#

Function Documentation#

inline void tvm::ffi::reflection::SetFieldToDefault(const TVMFFIFieldInfo *field_info, void *field_addr)#

Set a field to its default value, calling the factory if applicable.

When kTVMFFIFieldFlagBitMaskDefaultFromFactory is set, extracts the Function from default_value_or_factory, calls it with no arguments, and uses the result. Otherwise, passes default_value_or_factory directly to the setter.

Parameters:
  • field_info – The field info (must have kTVMFFIFieldFlagBitMaskHasDefault set).

  • field_addr – The address of the field in the object.