MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Empty

Method Empty

include/tvm/ffi/container/array.h:121–128  ·  view source on GitHub ↗

! * \brief Create an ArrayObj with the given capacity. * \param n Required capacity * \return Ref-counted ArrayObj requested */

Source from the content-addressed store, hash-verified

119 * \return Ref-counted ArrayObj requested
120 */
121 static ObjectPtr<ArrayObj> Empty(int64_t n = kInitSize) {
122 ObjectPtr<ArrayObj> p = make_inplace_array_object<ArrayObj, Any>(n);
123 p->TVMFFISeqCell::capacity = n;
124 p->TVMFFISeqCell::size = 0;
125 p->data = reinterpret_cast<char*>(p.get()) + sizeof(ArrayObj);
126 p->data_deleter = nullptr;
127 return p;
128 }
129
130 /*!
131 * \brief Inplace-initialize the elements starting idx from [first, last)

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected