tvm
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
attrs.h File Reference

Helpers for attribute objects. More...

#include <tvm/ffi/container/map.h>
#include <tvm/ffi/extra/structural_equal.h>
#include <tvm/ffi/extra/structural_hash.h>
#include <tvm/ffi/function.h>
#include <tvm/ffi/reflection/accessor.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ir/cow.h>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <utility>
Include dependency graph for attrs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::AttrsObj
 Base class of all attribute class. More...
 
class  tvm::Attrs
 Managed reference to AttrsObj. More...
 
class  tvm::DictAttrsObj
 Specialized attribute type that is backed by a map. The DictAttrsObj implements the Attrs behavior, its fields are directly accessible via object.field_name like other normal nodes. More...
 
class  tvm::DictAttrs
 Managed reference to DictAttrsObj. More...
 

Namespaces

namespace  tvm
 An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
 

Functions

template<typename TFunc >
TFunc tvm::WithAttr (TFunc input, const std::string &attr_key, Any attr_value)
 Copy the function or module, but overrides the attribute value key with the value.
 
template<typename TFunc , typename T , typename Value , std::enable_if_t<(std::is_convertible_v< Value &&, T > &&((!std::is_same_v< std::decay_t< Value >, ffi::Any > &&!std::is_same_v< std::decay_t< Value >, ffi::AnyView >)||std::is_same_v< T, ffi::Any >||std::is_same_v< T, ffi::AnyView >)), int > = 0>
TFunc tvm::WithAttr (TFunc input, ffi::reflection::AttrKey< T > key, Value &&value)
 Attach a typed value using the existing function or module copy-on-write path.
 
template<typename TFunc >
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.
 
template<typename TFunc >
TFunc tvm::WithoutAttr (TFunc input, const std::string &attr_key)
 Copy the function or module, but removes the specified attribute.
 
template<typename TFunc , typename T >
TFunc tvm::WithoutAttr (TFunc input, ffi::reflection::AttrKey< T > key)
 Remove a typed attribute using the existing copy-on-write path.
 

Detailed Description

Helpers for attribute objects.

This module enables declaration of named attributes which support default value setup and bound checking.

See also
AttrsObj