tvm
Public Types | Public Member Functions | List of all members
tvm::runtime::ShapeTuple Class Reference

Reference to shape tuple objects. More...

#include <shape_tuple.h>

Inheritance diagram for tvm::runtime::ShapeTuple:
Collaboration diagram for tvm::runtime::ShapeTuple:

Public Types

using index_type = ShapeTupleObj::index_type
 The type of shape index element. More...
 
- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 

Public Member Functions

 ShapeTuple ()
 Construct an empty shape tuple. More...
 
template<typename IterType >
 ShapeTuple (IterType begin, IterType end)
 Constructor from iterator. More...
 
 ShapeTuple (std::initializer_list< index_type > shape)
 constructor from initializer list More...
 
 ShapeTuple (std::vector< index_type > shape)
 Construct a new ShapeTuple object. More...
 
const index_typedata () const
 Return the data pointer. More...
 
size_t size () const
 Return the size of the shape tuple. More...
 
index_type operator[] (size_t idx) const
 Immutably read i-th element from the shape tuple. More...
 
index_type at (size_t idx) const
 Immutably read i-th element from the shape tuple. More...
 
bool empty () const
 
index_type front () const
 
index_type back () const
 
const index_typebegin () const
 
const index_typeend () const
 
 TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (ShapeTuple, ObjectRef, ShapeTupleObj)
 
- Public Member Functions inherited from tvm::runtime::ObjectRef
 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 Objectget () const
 
const Objectoperator-> () const
 
bool unique () const
 
int use_count () const
 
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
const ObjectType * as () const
 Try to downcast the internal Object to a raw pointer of a corresponding type. More...
 
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
Optional< ObjectRefType > as () const
 Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 
- Protected Member Functions inherited from tvm::runtime::ObjectRef
Objectget_mutable () const
 
- Static Protected Member Functions inherited from tvm::runtime::ObjectRef
template<typename T >
static T DowncastNoCheck (ObjectRef ref)
 Internal helper function downcast a ref without check. More...
 
static void FFIClearAfterMove (ObjectRef *ref)
 Clear the object ref data field without DecRef after we successfully moved the field. More...
 
template<typename ObjectType >
static ObjectPtr< ObjectType > GetDataPtr (const ObjectRef &ref)
 Internal helper function get data_ as ObjectPtr of ObjectType. More...
 
- Protected Attributes inherited from tvm::runtime::ObjectRef
ObjectPtr< Objectdata_
 Internal pointer that backs the reference. More...
 

Detailed Description

Reference to shape tuple objects.

Member Typedef Documentation

◆ index_type

The type of shape index element.

Constructor & Destructor Documentation

◆ ShapeTuple() [1/4]

tvm::runtime::ShapeTuple::ShapeTuple ( )
inline

Construct an empty shape tuple.

◆ ShapeTuple() [2/4]

template<typename IterType >
tvm::runtime::ShapeTuple::ShapeTuple ( IterType  begin,
IterType  end 
)
inline

Constructor from iterator.

Parameters
beginbegin of iterator
endend of iterator
Template Parameters
IterTypeThe type of iterator

◆ ShapeTuple() [3/4]

tvm::runtime::ShapeTuple::ShapeTuple ( std::initializer_list< index_type shape)
inline

constructor from initializer list

Parameters
shapeThe initializer list

◆ ShapeTuple() [4/4]

tvm::runtime::ShapeTuple::ShapeTuple ( std::vector< index_type shape)
inline

Construct a new ShapeTuple object.

Parameters
shapeThe moved/copied std::vector object
Note
If user passes const reference, it will trigger copy. If it's rvalue, it will be moved into other.

Member Function Documentation

◆ at()

index_type tvm::runtime::ShapeTuple::at ( size_t  idx) const
inline

Immutably read i-th element from the shape tuple.

Parameters
idxThe index
Returns
the i-th element.

◆ back()

index_type tvm::runtime::ShapeTuple::back ( ) const
inline
Returns
The last element of the shape tuple

◆ begin()

const index_type* tvm::runtime::ShapeTuple::begin ( ) const
inline
Returns
begin iterator

◆ data()

const index_type* tvm::runtime::ShapeTuple::data ( ) const
inline

Return the data pointer.

Returns
const index_type* data pointer

◆ empty()

bool tvm::runtime::ShapeTuple::empty ( ) const
inline
Returns
Whether shape tuple is empty

◆ end()

const index_type* tvm::runtime::ShapeTuple::end ( ) const
inline
Returns
end iterator

◆ front()

index_type tvm::runtime::ShapeTuple::front ( ) const
inline
Returns
The first element of the shape tuple

◆ operator[]()

index_type tvm::runtime::ShapeTuple::operator[] ( size_t  idx) const
inline

Immutably read i-th element from the shape tuple.

Parameters
idxThe index
Returns
the i-th element.

◆ size()

size_t tvm::runtime::ShapeTuple::size ( ) const
inline

Return the size of the shape tuple.

Returns
size_t shape tuple size

◆ TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS()

tvm::runtime::ShapeTuple::TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS ( ShapeTuple  ,
ObjectRef  ,
ShapeTupleObj   
)

The documentation for this class was generated from the following file: