Template Function tvm::WithAttrs

Template Function tvm::WithAttrs#

Function Documentation#

template<typename TFunc>
inline TFunc tvm::WithAttrs(TFunc input, ffi::Map<ffi::String, Any> attrs)#

Copy the function or module, but overrides the attributes with the entries from attrs.

Parameters:
  • input – The thing to annotate (BaseFunc or IRModule)

  • attrs – Key/values attributes to add to input.

Template Parameters:

TFunc – The corresponding function or module type, including BaseFunc. Shared inputs must register a reflected shallow-copy constructor.

Returns:

The new function or module with updated attributes.