Class ArrayObj#

Inheritance Relationships#

Base Types#

  • public tvm::ffi::Object (Class Object)

  • public tvm::ffi::details::InplaceArrayBase< ArrayObj, TVMFFIAny >

Class Documentation#

class ArrayObj : public tvm::ffi::Object, public tvm::ffi::details::InplaceArrayBase<ArrayObj, TVMFFIAny>#

Array node content in array.

Public Functions

inline ~ArrayObj()#
inline size_t size() const#
Returns:

The size of the array

inline const Any &at(int64_t i) const#

Read i-th element from array.

Parameters:

i – The index

Returns:

the i-th element.

inline const Any *begin() const#
Returns:

begin constant iterator

inline const Any *end() const#
Returns:

end constant iterator

inline void clear()#

Release reference to all the elements.

inline void SetItem(int64_t i, Any item)#

Set i-th element of the array in-place.

Parameters:
  • i – The index

  • item – The value to be set

Public Static Functions

static inline ObjectPtr<ArrayObj> CopyFrom(int64_t cap, ArrayObj *from)#

Constructs a container and copy from another.

Parameters:
  • cap – The capacity of the container

  • from – Source of the copy

Returns:

Ref-counted ArrayObj requested

static inline ObjectPtr<ArrayObj> MoveFrom(int64_t cap, ArrayObj *from)#

Constructs a container and move from another.

Parameters:
  • cap – The capacity of the container

  • from – Source of the move

Returns:

Ref-counted ArrayObj requested

static inline ObjectPtr<ArrayObj> CreateRepeated(int64_t n, const Any &val)#

Constructs a container with n elements. Each element is a copy of val.

Parameters:
  • n – The size of the container

  • val – The init value

Returns:

Ref-counted ArrayObj requested