Template Function tvm::WithoutAttr(TFunc, const std::string&)#
Defined in File attrs.h
Function Documentation#
-
template<typename TFunc>
inline TFunc tvm::WithoutAttr(TFunc input, const std::string &attr_key)# Copy the function or module, but removes the specified attribute.
This is also why we make it as a function instead of a member function and why we pass by value in the first argument.
// Recommended way to trigger copy on write func = WithoutAttr(std::move(func), "key1"); func = WithoutAttr(std::move(func), "key2");
Note
This function performs copy on write optimization for func and module. If we move a uniquely referenced func or module into WithoutAttr, then no additional copy will be performed.
- Parameters:
- 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 removed attribute.