24 #ifndef TVM_RELAX_ATTRS_MANIPULATE_H_
25 #define TVM_RELAX_ATTRS_MANIPULATE_H_
40 "The axis at which the input arrays are concatenated."
41 "Should lie in range `[-ndim, ndim)`.");
44 static constexpr
const char*
_type_key =
"relax.attrs.ConcatAttrs";
54 refl::ObjectDef<ExpandDimsAttrs>().def_ro(
56 "The axes at which the input array are expanded. "
57 "All values are required to lie in range `[-data.ndim - 1, data.ndim]`, "
58 "with the convention of negative indexing.");
61 static constexpr
const char*
_type_key =
"relax.attrs.ExpandDimsAttrs";
87 refl::ObjectDef<LayoutTransformAttrs>()
89 "The layout transformation to apply.")
92 "The specific value to be used to pad if the layout transform would result in implicit "
93 "padding. If not specified, the compiler is free to choose any value.")
95 "The separators between input axes when generating flat output axes")
97 "The separators between axes to regenerate output");
100 static constexpr
const char*
_type_key =
"relax.attrs.LayoutTransformAttrs";
110 refl::ObjectDef<PermuteDimsAttrs>().def_ro(
114 static constexpr
const char*
_type_key =
"relax.attrs.PermuteDimsAttrs";
125 refl::ObjectDef<SplitAttrs>()
127 "The input array of indices or the number of split sections.")
131 static constexpr
const char*
_type_key =
"relax.attrs.SplitAttrs";
142 "The axis to squeeze in the input tensor."
143 "If `axis = None`, all axis of dimension 1 get squeezed;"
144 "Else, the dimension in axes get squeezed."
145 "It is an error if an axis does not has dimension 1.");
148 static constexpr
const char*
_type_key =
"relax.attrs.SqueezeAttrs";
158 refl::ObjectDef<StackAttrs>().def_ro(
160 "The axis along which to stack the input tensors. "
161 "The axis will be inserted at this position in the output, "
162 "so it must be in range [-ndim-1, ndim] where ndim is the "
163 "number of dimensions of the input tensors.");
166 static constexpr
const char*
_type_key =
"relax.attrs.StackAttrs";
177 refl::ObjectDef<RepeatAttrs>()
180 "The axis along which to repeat values. The negative numbers are interpreted "
181 "counting from the backward. By default, use the flattened input array, and "
182 "return a flat output array.");
185 static constexpr
const char*
_type_key =
"relax.attrs.RepeatAttrs";
196 "The number of repetitions of data along each axis.");
199 static constexpr
const char*
_type_key =
"relax.attrs.TileAttrs";
210 "The axis along which to flip over.",
211 refl::DefaultValue(NullValue<Integer>()));
214 static constexpr
const char*
_type_key =
"relax.attrs.FlipAttrs";
225 "The axis along which to index.",
226 refl::DefaultValue(0));
229 static constexpr
const char*
_type_key =
"relax.attrs.GatherElementsAttrs";
240 "The number of batch dims.", refl::DefaultValue(0));
243 static constexpr
const char*
_type_key =
"relax.attrs.GatherNDAttrs";
253 refl::ObjectDef<IndexPutAttrs>().def_ro(
255 "Whether to accumulate (add) values rather than replace. "
256 "If true, performs tensor[indices] += values, "
257 "otherwise performs tensor[indices] = values.",
258 refl::DefaultValue(
false));
261 static constexpr
const char*
_type_key =
"relax.attrs.IndexPutAttrs";
272 "Specifies how the grid dimensions are ordered.");
275 static constexpr
const char*
_type_key =
"relax.attrs.MeshgridAttrs";
286 refl::ObjectDef<ScatterElementsAttrs>()
288 refl::DefaultValue(0))
290 "Reduction mode of the scatter elements, "
291 "either \"update\", \"add\", \"mul\", \"mean\", \"min\" or \"max\".",
292 refl::DefaultValue(
"update"));
295 static constexpr
const char*
_type_key =
"relax.attrs.ScatterElementsAttrs";
305 refl::ObjectDef<ScatterNDAttrs>().def_ro(
307 "Accumulation mode of the ScatterND, "
308 "either \"update\", \"add\", \"mul\", \"min\" or \"max\".",
309 refl::DefaultValue(
"update"));
312 static constexpr
const char*
_type_key =
"relax.attrs.ScatterNDAttrs";
323 "the dimension to insert the slice into ",
324 refl::DefaultValue(0));
327 static constexpr
const char*
_type_key =
"relax.attrs.SliceScatterAttrs";
338 refl::ObjectDef<OneHotAttrs>()
343 static constexpr
const char*
_type_key =
"relax.attrs.OneHotAttrs";
Adapter for AttrsNode with the new reflection API.
Definition: attrs.h:384
Base class of all attribute class.
Definition: attrs.h:103
Container of constant int that adds more constructors.
Definition: expr.h:612
Definition: index_map.h:169
Defines a remapping of buffer indices.
Definition: repr_printer.h:91
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
Attributes used in concat operators.
Definition: manipulate.h:34
static void RegisterReflection()
Definition: manipulate.h:37
Optional< int64_t > axis
Definition: manipulate.h:35
static constexpr const char * _type_key
Definition: manipulate.h:44
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(ConcatAttrs, BaseAttrsNode)
Attributes used in expand_dims operators.
Definition: manipulate.h:49
static void RegisterReflection()
Definition: manipulate.h:52
static constexpr const char * _type_key
Definition: manipulate.h:61
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(ExpandDimsAttrs, BaseAttrsNode)
Array< Integer > axis
Definition: manipulate.h:50
Attributes used in flip operators.
Definition: manipulate.h:204
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(FlipAttrs, BaseAttrsNode)
static void RegisterReflection()
Definition: manipulate.h:207
static constexpr const char * _type_key
Definition: manipulate.h:214
Integer axis
Definition: manipulate.h:205
Attributes used in gather_elements operators.
Definition: manipulate.h:219
static void RegisterReflection()
Definition: manipulate.h:222
static constexpr const char * _type_key
Definition: manipulate.h:229
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(GatherElementsAttrs, BaseAttrsNode)
Integer axis
Definition: manipulate.h:220
Attributes used in gather_nd operators.
Definition: manipulate.h:234
Integer batch_dims
Definition: manipulate.h:235
static constexpr const char * _type_key
Definition: manipulate.h:243
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(GatherNDAttrs, BaseAttrsNode)
static void RegisterReflection()
Definition: manipulate.h:237
Attributes used in index_put operator.
Definition: manipulate.h:248
bool accumulate
Definition: manipulate.h:249
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(IndexPutAttrs, BaseAttrsNode)
static constexpr const char * _type_key
Definition: manipulate.h:261
static void RegisterReflection()
Definition: manipulate.h:251
Attribute used in meshgrid operator.
Definition: manipulate.h:266
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(MeshgridAttrs, BaseAttrsNode)
Optional< String > indexing
Definition: manipulate.h:267
static void RegisterReflection()
Definition: manipulate.h:269
static constexpr const char * _type_key
Definition: manipulate.h:275
Attributes used in one_hot operator.
Definition: manipulate.h:332
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(OneHotAttrs, BaseAttrsNode)
static void RegisterReflection()
Definition: manipulate.h:336
int axis
Definition: manipulate.h:334
static constexpr const char * _type_key
Definition: manipulate.h:343
int depth
Definition: manipulate.h:333
Attributes used in permute_dims operator.
Definition: manipulate.h:105
static void RegisterReflection()
Definition: manipulate.h:108
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(PermuteDimsAttrs, BaseAttrsNode)
static constexpr const char * _type_key
Definition: manipulate.h:114
Optional< Array< Integer > > axes
Definition: manipulate.h:106
Attributes used in repeat operators.
Definition: manipulate.h:171
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(RepeatAttrs, BaseAttrsNode)
static constexpr const char * _type_key
Definition: manipulate.h:185
Optional< int64_t > axis
Definition: manipulate.h:173
int repeats
Definition: manipulate.h:172
static void RegisterReflection()
Definition: manipulate.h:175
Attributes used in scatter_elements operators.
Definition: manipulate.h:280
String reduction
Definition: manipulate.h:282
Integer axis
Definition: manipulate.h:281
static constexpr const char * _type_key
Definition: manipulate.h:295
static void RegisterReflection()
Definition: manipulate.h:284
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(ScatterElementsAttrs, BaseAttrsNode)
Attributes used in scatter_nd operators.
Definition: manipulate.h:300
String reduction
Definition: manipulate.h:301
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(ScatterNDAttrs, BaseAttrsNode)
static constexpr const char * _type_key
Definition: manipulate.h:312
static void RegisterReflection()
Definition: manipulate.h:303
Attributes used in slice_scatter operator.
Definition: manipulate.h:317
static void RegisterReflection()
Definition: manipulate.h:320
static constexpr const char * _type_key
Definition: manipulate.h:327
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(SliceScatterAttrs, BaseAttrsNode)
int axis
Definition: manipulate.h:318
Attributes used in split operator.
Definition: manipulate.h:119
static void RegisterReflection()
Definition: manipulate.h:123
ObjectRef indices_or_sections
Definition: manipulate.h:120
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(SplitAttrs, BaseAttrsNode)
static constexpr const char * _type_key
Definition: manipulate.h:131
int axis
Definition: manipulate.h:121
Attributes used in squeeze operators.
Definition: manipulate.h:136
Optional< Array< Integer > > axis
Definition: manipulate.h:137
static constexpr const char * _type_key
Definition: manipulate.h:148
static void RegisterReflection()
Definition: manipulate.h:139
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(SqueezeAttrs, BaseAttrsNode)
Attributes used in stack operators.
Definition: manipulate.h:153
Optional< Integer > axis
Definition: manipulate.h:154
static void RegisterReflection()
Definition: manipulate.h:156
static constexpr const char * _type_key
Definition: manipulate.h:166
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(StackAttrs, BaseAttrsNode)
Attributes used in tile operators.
Definition: manipulate.h:190
static void RegisterReflection()
Definition: manipulate.h:193
static constexpr const char * _type_key
Definition: manipulate.h:199
Array< Integer > repeats
Definition: manipulate.h:191
TVM_FFI_DECLARE_FINAL_OBJECT_INFO(TileAttrs, BaseAttrsNode)