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

Method CreateRepeated

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

! * \brief Constructs a container with n elements. Each element is a copy of val * \param n The size of the container * \param val The init value * \return Ref-counted ArrayObj requested */

Source from the content-addressed store, hash-verified

95 * \return Ref-counted ArrayObj requested
96 */
97 static ObjectPtr<ArrayObj> CreateRepeated(int64_t n, const Any& val) {
98 ObjectPtr<ArrayObj> p = ArrayObj::Empty(n);
99 Any* itr = p->MutableBegin();
100 for (int64_t& i = p->TVMFFISeqCell::size = 0; i < n; ++i) {
101 new (itr++) Any(val);
102 }
103 return p;
104 }
105
106 /// \cond Doxygen_Suppress
107 static constexpr const int32_t _type_index = TypeIndex::kTVMFFIArray;

Callers

nothing calls this directly

Calls 2

MutableBeginMethod · 0.80
EmptyFunction · 0.50

Tested by

no test coverage detected