|
| | Map () |
| | default constructor More...
|
| |
| | Map (Map< K, V > &&other) |
| | move constructor More...
|
| |
| | Map (const Map< K, V > &other) |
| | copy constructor More...
|
| |
| Map< K, V > & | operator= (Map< K, V > &&other) |
| | copy assign operator More...
|
| |
| Map< K, V > & | operator= (const Map< K, V > &other) |
| | move assign operator More...
|
| |
| | Map (ObjectPtr< Object > n) |
| | constructor from pointer More...
|
| |
| template<typename IterType > |
| | Map (IterType begin, IterType end) |
| | constructor from iterator More...
|
| |
| | Map (std::initializer_list< std::pair< K, V >> init) |
| | constructor from initializer list More...
|
| |
| template<typename Hash , typename Equal > |
| | Map (const std::unordered_map< K, V, Hash, Equal > &init) |
| | constructor from unordered_map More...
|
| |
| const V | at (const K &key) const |
| | Read element from map. More...
|
| |
| const V | operator[] (const K &key) const |
| | Read element from map. More...
|
| |
| size_t | size () const |
| |
| size_t | count (const K &key) const |
| |
| bool | empty () const |
| |
| void | clear () |
| | Release reference to all the elements. More...
|
| |
| void | Set (const K &key, const V &value) |
| | set the Map. More...
|
| |
| iterator | begin () const |
| |
| iterator | end () const |
| |
| iterator | find (const K &key) const |
| |
| Optional< V > | Get (const K &key) const |
| |
| void | erase (const K &key) |
| |
| MapNode * | CopyOnWrite () |
| | copy on write semantics Do nothing if current handle is the unique copy of the array. Otherwise make a new copy of the array to ensure the current handle hold a unique copy. More...
|
| |
| | ObjectRef ()=default |
| | default constructor More...
|
| |
| | ObjectRef (ObjectPtr< Object > data) |
| | Constructor from existing object ptr. More...
|
| |
| bool | same_as (const ObjectRef &other) const |
| | Comparator. More...
|
| |
| bool | operator== (const ObjectRef &other) const |
| | Comparator. More...
|
| |
| bool | operator!= (const ObjectRef &other) const |
| | Comparator. More...
|
| |
| bool | operator< (const ObjectRef &other) const |
| | Comparator. More...
|
| |
| bool | defined () const |
| |
| const Object * | get () const |
| |
| const Object * | operator-> () const |
| |
| bool | unique () const |
| |
| int | use_count () const |
| |
| template<typename ObjectType > |
| const ObjectType * | as () const |
| | Try to downcast the internal Object to a raw pointer of a corresponding type. More...
|
| |
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
class tvm::runtime::Map< K, V, typename, typename >
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
operator[] only provide const acces, use Set to mutate the content.
- Template Parameters
-
| K | The key NodeRef type. |
| V | The value NodeRef type. |
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
template<typename IterType >
constructor from iterator
- Parameters
-
| begin | begin of iterator |
| end | end of iterator |
- Template Parameters
-
| IterType | The type of iterator |
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
| tvm::runtime::Map< K, V, typename, typename >::Map |
( |
std::initializer_list< std::pair< K, V >> |
init | ) |
|
|
inline |
constructor from initializer list
- Parameters
-
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
template<typename Hash , typename Equal >
| tvm::runtime::Map< K, V, typename, typename >::Map |
( |
const std::unordered_map< K, V, Hash, Equal > & |
init | ) |
|
|
inline |
constructor from unordered_map
- Parameters
-
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
Release reference to all the elements.
template<typename K, typename V, typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
copy on write semantics Do nothing if current handle is the unique copy of the array. Otherwise make a new copy of the array to ensure the current handle hold a unique copy.
- Returns
- Handle to the internal node container(which guarantees to be unique)