24 #ifndef TVM_RELAY_ATTRS_TRANSFORM_H_
25 #define TVM_RELAY_ATTRS_TRANSFORM_H_
44 "What axis the sliding window begin forming over."
45 "Window will be slid over this axis and all following axes."
46 "The axis value determines the window shape (and thus, the"
48 "window shape and strides must both be of length"
52 "The window shape to form over the input."
53 "Window shape must be of length `data.ndim-axis`.");
55 "How to stride the window along each dimension."
56 "Strides must be of length `data.ndim-axis`.");
76 "The axis at which the input array is expanded."
77 "Should lie in range `[-data.ndim - 1, data.ndim]`."
78 "If `axis < 0`, it is the first axis inserted;"
79 "If `axis >= 0`, it is the last axis inserted in Python's negative indexing.");
81 .describe(
"Number of axes to be inserted. Should be >= 0.")
93 .describe(
"Number of axes to be inserted. Should be >= 0.")
105 "The axis at which the input arrays are concatenated."
106 "Should lie in range `[-ndim, ndim)`.")
115 TVM_ATTR_FIELD(
axes).describe(
"The target axes order, reverse order if not specified.");
125 "The new shape. Should be compatible with the original shape.");
127 "Whether to honor the value of zero in newshape.");
139 "The axis of the input where reshaping should begin.");
141 .set_default(NullValue<Integer>())
142 .describe(
"The axis of the input where reshaping should end, exclusive.");
144 "The axis of the shape_like tensor to begin taking dimensions from.");
146 .set_default(NullValue<Integer>())
147 .describe(
"The axis of the shape_like tensor to end taking dimensions from, exclusive.");
156 TVM_ATTR_FIELD(
axis).set_default(0).describe(
"The axis over which to select values.");
158 "Reduction mode of the scatter elements, "
159 "either \"update\", \"add\", \"mul\", \"mean\", \"min\" or \"max\".");
168 "Accumulation mode of the ScatterND, "
169 "either \"update\", \"add\", \"mul\", \"min\" or \"max\".");
178 .set_default(NullValue<Integer>())
179 .describe(
"The axis over which to select values.");
190 .set_default(NullValue<Integer>())
192 "The size of an indexing tuple, which is a fixed value. Only needed when the number of "
193 "indexting tuples is dynamic.");
205 .describe(
"The batch_dims over which to select values.");
207 .set_default(NullValue<Integer>())
208 .describe(
"The axis over which to select values.");
210 "Specify how out-of-bound indices will behave."
211 "clip - clip to the range (default)"
212 "wrap - wrap around the indices"
213 "fast - no clip or wrap around (user must make sure indices are in-bound)");
237 TVM_ATTR_FIELD(
stop).describe(
"Stop of interval. The interval does not include this value.");
250 "Indexing mode, either \"ij\" for matrix or \"xy\" for cartesian in which first two"
251 "dimensions are swapped.")
261 "The axis in the result array along which the input arrays are stacked.");
272 .set_default(NullValue<Integer>())
273 .describe(
" The axis along which to repeat values.");
282 "The number of times for repeating the tensor a."
283 "Each dim sizeof reps must be a positive integer.");
292 .set_default(NullValue<Integer>())
293 .describe(
"The axis along which to reverse elements.");
304 "The seq axis along which to reverse elements.");
307 .describe(
"The batch axis along which to slice the tensor.");
319 "The axis to squeeze in the input tensor."
320 "If `axis = None`, all axis of dimension 1 get squeezed;"
321 "Else, the dimension in axes get squeezed."
322 "It is an error if an axis does not has dimension 1.")
334 "Indices or sections to split into. Accepts an int or a tuple"
335 "If indices_or_sections is an integer, the input will be divided equally"
336 "along given axis. If such a split is not possible, an error is raised."
337 "If indices_or_sections is a tuple of sorted integers,"
338 "the entries indicate where along axis the array is split.");
352 TVM_ATTR_FIELD(
begin).describe(
"Indices for begin of slice, begin index is also inclusive");
353 TVM_ATTR_FIELD(
end).describe(
"Indices for end of slice, end index is exclusive");
355 "Stride values of the slice, a stride can be negative, which causes a reverse slice.");
359 "The slice mode [end, size]."
360 "end - The default slice mode, ending indices for the slice."
361 "size - The input strides will be ignored, input end in this mode indicates the size"
362 "of a slice starting at the location specified by begin. If end[i] is -1,"
363 "all remaining elements in that dimension are included in the slice");
365 "Axes along which slicing is applied. When it is specified, the length of begin, end, "
366 "strides, and axes must be equal.");
375 "List of axes on which input data will be sliced according to the "
376 "corresponding size of the second input. By default will slice "
377 "on all axes. Negative axes mean counting in reverse.");
399 .describe(
"Multiplier of a fixed floating point number described as multiplier*2^(shift)");
401 "Shift of a fixed floating point number described as multiplier*2^(shift)");
413 .describe(
"Whether left shift is required in fixed point multiplication.")
416 .describe(
"Whether right shift is required in fixed point multiplication.")
440 "relay.attrs.AutoSchedulerLayoutTransformAttrs") {
443 .describe(
"The destination layout of the tensor. (e.g. 1N2C112H112W16c)");
452 "relay.attrs.MetaScheduleLayoutTransformAttrs") {
454 "The order of the extents, for example, "
455 "let extents = [2, 3, 4], reorder = [0, 2, 1], and the shape of buffer A is (4, 6)"
456 "then A[i, j] will be first rewritten to "
457 "A[(6 * i + j) / 12, (6 * i + j) / 4 % 3 , (6 * i + j) % 4] according to the `extents`,"
458 "and then reordered to A[(6 * i + j) / 12, (6 * i + j) % 4 , (6 * i + j) / 4 % 3]"
459 "according to `reorder`");
479 "The axis of the length dimension. Can only be 0 or 1.");
522 TVM_ATTR_FIELD(
k1).set_default(0).describe(
"Lower limit (included) of the range of diagonals.");
523 TVM_ATTR_FIELD(
k2).set_default(0).describe(
"Upper limit (included) of the range of diagonals.");
526 .describe(
"Bool, true iff super-diagonal is right aligned (left-padded).");
529 .describe(
"Bool, true iff sub-diagonal is right aligned (left-padded).");
539 TVM_ATTR_FIELD(
axis).describe(
"The axis to operate over").set_default(NullValue<Integer>());
544 .describe(
"The first element is not included")
545 .set_default(
Bool(
false));
556 .describe(
"Whether to return an additional tensor with counts of each unique elements")
582 .describe(
"The distance between neighboring sliding window frames");
586 .describe(
"Whether to return the normalized STFT results");
588 "Whether to return onesided result or fill with conjugate symmetry");
598 .describe(
"Whether to perform the inverse discrete Fourier transform")
599 .set_default(
Bool(
false));
608 "Whether to keep the upper or lower half of the diagonal.");
The base class of the all the Use "curiously recurring template pattern".
Definition: attrs.h:870
Boolean constant.
Definition: expr.h:597
Container of constant int that adds more constructors.
Definition: expr.h:632
Managed reference to RelayExprNode.
Definition: expr.h:442
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Runtime primitive data type.
Definition: data_type.h:43
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reference to string objects.
Definition: string.h:98
Definition: index_map.h:176
Defines a remapping of buffer indices.
Helpers for attribute objects.
#define TVM_ATTR_FIELD(FieldName)
Declare an attribute field.
Definition: attrs.h:76
Box< bool > Bool
Boxed version of C++ bool.
Definition: boxed_primitive.h:121
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
DataType NullValue< DataType >()
Definition: attrs.h:90
TObjectRef NullValue()
Create a NodeRef type that represents null.
Definition: attrs.h:84
Base classes for the Relay IR.
Relay expression language.
Attributes used in arange operators.
Definition: transform.h:229
Expr stop
Definition: transform.h:231
DataType dtype
Definition: transform.h:233
Expr step
Definition: transform.h:232
TVM_DECLARE_ATTRS(ArangeAttrs, "relay.attrs.ArangeAttrs")
Definition: transform.h:235
Expr start
Definition: transform.h:230
data type cast
Definition: transform.h:61
DataType dtype
Definition: transform.h:62
TVM_DECLARE_ATTRS(CastAttrs, "relay.attrs.CastAttrs")
Definition: transform.h:64
Attributes for Clip operator.
Definition: transform.h:382
double a_min
Definition: transform.h:383
TVM_DECLARE_ATTRS(ClipAttrs, "relay.attrs.ClipAttrs")
Definition: transform.h:386
double a_max
Definition: transform.h:384
Attributes used in concatenate operators.
Definition: transform.h:100
TVM_DECLARE_ATTRS(ConcatenateAttrs, "relay.attrs.ConcatenateAttrs")
Definition: transform.h:102
int axis
Definition: transform.h:101
Attributes used in DFT operator.
Definition: transform.h:593
Bool inverse
Definition: transform.h:594
TVM_DECLARE_ATTRS(DFTAttrs, "relay.attrs.DFTAttrs")
Definition: transform.h:596
Attributes used in dynamic expand_dims operators.
Definition: transform.h:88
int num_newaxis
Definition: transform.h:89
TVM_DECLARE_ATTRS(DynExpandDimsAttrs, "relay.attrs.DynExpandDimsAttrs")
Definition: transform.h:91
Attributes used in einsum operator.
Definition: transform.h:562
TVM_DECLARE_ATTRS(EinsumAttrs, "relay.attrs.EinsumAttrs")
Definition: transform.h:565
String equation
Definition: transform.h:563
Attributes used in expand_dims operators.
Definition: transform.h:70
int axis
Definition: transform.h:71
TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs")
Definition: transform.h:74
int num_newaxis
Definition: transform.h:72
Attributes for FixedPointMultiply operator.
Definition: transform.h:393
TVM_DECLARE_ATTRS(FixedPointMultiplyAttrs, "relay.attrs.FixedPointMultiplyAttrs")
Definition: transform.h:397
int32_t multiplier
Definition: transform.h:394
int32_t shift
Definition: transform.h:395
Attributes for per channel/per axes FixedPointMultiply operator.
Definition: transform.h:406
bool is_rshift_required
Definition: transform.h:408
bool is_lshift_required
Definition: transform.h:407
TVM_DECLARE_ATTRS(FixedPointMultiplyPerAxisAttrs, "relay.attrs.FixedPointMultiplyPerAxisAttrs")
Definition: transform.h:411
Array< Integer > axes
Definition: transform.h:409
Definition: transform.h:173
TVM_DECLARE_ATTRS(GatherAttrs, "relay.attrs.GatherAttrs")
Definition: transform.h:176
Integer axis
Definition: transform.h:174
Definition: transform.h:183
TVM_DECLARE_ATTRS(GatherNDAttrs, "relay.attrs.GatherNDAttrs")
Definition: transform.h:187
Integer batch_dims
Definition: transform.h:184
Optional< Integer > index_rank
Definition: transform.h:185
Attributes that specify a tensor.
Definition: transform.h:218
TVM_DECLARE_ATTRS(InitOpAttrs, "relay.attrs.InitOpAttrs")
Definition: transform.h:222
DataType dtype
Definition: transform.h:220
Optional< Array< Integer > > shape
Definition: transform.h:219
Attributes used in matrix_set_diag operator.
Definition: transform.h:515
int k2
Definition: transform.h:517
bool sub_diag_right_align
Definition: transform.h:519
TVM_DECLARE_ATTRS(MatrixSetDiagAttrs, "relay.attrs.MatrixSetDiagAttrs")
Definition: transform.h:521
int k1
Definition: transform.h:516
bool super_diag_right_align
Definition: transform.h:518
Attributes used in meshgrid operators.
Definition: transform.h:244
std::string indexing
Definition: transform.h:245
TVM_DECLARE_ATTRS(MeshgridAttrs, "relay.attrs.MeshgridAttrs")
Definition: transform.h:247
Attributes for ndarray_size operator.
Definition: transform.h:493
DataType dtype
Definition: transform.h:494
TVM_DECLARE_ATTRS(NdarraySizeAttrs, "relay.attrs.NdarraySizeAttrs")
Definition: transform.h:496
Attributes used in one-hot operator.
Definition: transform.h:502
int depth
Definition: transform.h:503
int axis
Definition: transform.h:504
TVM_DECLARE_ATTRS(OneHotAttrs, "relay.attrs.OneHotAttrs")
Definition: transform.h:507
DataType dtype
Definition: transform.h:505
Attributes used in repeat operators.
Definition: transform.h:266
TVM_DECLARE_ATTRS(RepeatAttrs, "relay.attrs.RepeatAttrs")
Definition: transform.h:269
Integer axis
Definition: transform.h:268
Integer repeats
Definition: transform.h:267
Attributes used in reshape operators.
Definition: transform.h:120
bool allowzero
Definition: transform.h:122
Array< Integer > newshape
Definition: transform.h:121
TVM_DECLARE_ATTRS(ReshapeAttrs, "relay.attrs.ReshapeAttrs")
Definition: transform.h:123
Attributes used in MXNet-style reshape_like operators.
Definition: transform.h:132
Integer rhs_end
Definition: transform.h:136
int rhs_begin
Definition: transform.h:135
TVM_DECLARE_ATTRS(ReshapeLikeAttrs, "relay.attrs.ReshapeLikeAttrs")
Definition: transform.h:137
int lhs_begin
Definition: transform.h:133
Integer lhs_end
Definition: transform.h:134
Attributes used in reverse operators.
Definition: transform.h:288
Integer axis
Definition: transform.h:289
TVM_DECLARE_ATTRS(ReverseAttrs, "relay.attrs.ReverseAttrs")
Definition: transform.h:290
Attributes used in reverse_sequence operators.
Definition: transform.h:298
TVM_DECLARE_ATTRS(ReverseSequenceAttrs, "relay.attrs.ReverseSequenceAttrs")
Definition: transform.h:302
Integer batch_axis
Definition: transform.h:300
Integer seq_axis
Definition: transform.h:299
Attributes used in cumsum and cumprod operator.
Definition: transform.h:534
TVM_DECLARE_ATTRS(ScanopAttrs, "relay.attrs.ScanopAttrs")
Definition: transform.h:538
Bool exclusive
Definition: transform.h:537
DataType dtype
Definition: transform.h:536
Integer axis
Definition: transform.h:535
Definition: transform.h:151
String reduction
Definition: transform.h:153
TVM_DECLARE_ATTRS(ScatterElementsAttrs, "relay.attrs.ScatterElementsAttrs")
Definition: transform.h:155
Integer axis
Definition: transform.h:152
Definition: transform.h:163
TVM_DECLARE_ATTRS(ScatterNDAttrs, "relay.attrs.ScatterNDAttrs")
Definition: transform.h:166
String mode
Definition: transform.h:164
Definition: transform.h:472
TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs")
Definition: transform.h:476
int axis
Definition: transform.h:474
double mask_value
Definition: transform.h:473
Attributes for ShapeOf operator.
Definition: transform.h:464
DataType dtype
Definition: transform.h:465
TVM_DECLARE_ATTRS(ShapeOfAttrs, "relay.attrs.ShapeOfAttrs")
Definition: transform.h:467
Definition: transform.h:370
Array< Integer > axes
Definition: transform.h:371
TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs")
Definition: transform.h:373
Attributes used for the sliding_window operator.
Definition: transform.h:38
TVM_DECLARE_ATTRS(SlidingWindowAttrs, "relay.attrs.SlidingWindowAttrs")
Definition: transform.h:42
Array< Integer > strides
Definition: transform.h:41
Array< Integer > window_shape
Definition: transform.h:40
int axis
Definition: transform.h:39
Attributes used in sparse_to_dense operator.
Definition: transform.h:484
TVM_DECLARE_ATTRS(SparseToDenseAttrs, "relay.attrs.SparseToDenseAttrs")
Definition: transform.h:487
Array< Integer > output_shape
Definition: transform.h:485
Definition: transform.h:327
TVM_DECLARE_ATTRS(SplitAttrs, "relay.attrs.SplitAttrs")
Definition: transform.h:331
Variant< runtime::Int, Array< runtime::Int > > indices_or_sections
Definition: transform.h:328
int axis
Definition: transform.h:329
Attributes used in squeeze operators.
Definition: transform.h:312
TVM_DECLARE_ATTRS(SqueezeAttrs, "relay.attrs.SqueezeAttrs")
Definition: transform.h:316
Array< Integer > axis
Definition: transform.h:314
Attributes used in stack operators.
Definition: transform.h:257
Integer axis
Definition: transform.h:258
TVM_DECLARE_ATTRS(StackAttrs, "relay.attrs.StackAttrs")
Definition: transform.h:259
Attributes used in stft operator.
Definition: transform.h:571
bool onesided
Definition: transform.h:576
int win_length
Definition: transform.h:574
int hop_length
Definition: transform.h:573
int n_fft
Definition: transform.h:572
TVM_DECLARE_ATTRS(StftAttrs, "relay.attrs.StftAttrs")
Definition: transform.h:578
bool normalized
Definition: transform.h:575
Attributes for StridedSlice operator.
Definition: transform.h:344
Optional< Array< Integer > > end
Definition: transform.h:346
tvm::String slice_mode
Definition: transform.h:348
Optional< Array< Integer > > strides
Definition: transform.h:347
Optional< Array< Integer > > begin
Definition: transform.h:345
TVM_DECLARE_ATTRS(StridedSliceAttrs, "relay.attrs.StridedSliceAttrs")
Definition: transform.h:351
Optional< Array< Integer > > axes
Definition: transform.h:349
Definition: transform.h:197
tvm::String mode
Definition: transform.h:200
Integer axis
Definition: transform.h:199
TVM_DECLARE_ATTRS(TakeAttrs, "relay.attrs.TakeAttrs")
Definition: transform.h:202
Integer batch_dims
Definition: transform.h:198
Attributes used in tile operators.
Definition: transform.h:278
Array< Integer > reps
Definition: transform.h:279
TVM_DECLARE_ATTRS(TileAttrs, "relay.attrs.TileAttrs")
Definition: transform.h:280
Attributes used in transpose operators.
Definition: transform.h:112
Array< Integer > axes
Definition: transform.h:113
TVM_DECLARE_ATTRS(TransposeAttrs, "relay.attrs.TransposeAttrs")
Definition: transform.h:114
Definition: transform.h:603
bool upper
Definition: transform.h:604
TVM_DECLARE_ATTRS(TriluAttrs, "relay.attrs.TriluAttrs")
Definition: transform.h:606
Attributes used in unique operator.
Definition: transform.h:550
TVM_DECLARE_ATTRS(UniqueAttrs, "relay.attrs.UniqueAttrs")
Definition: transform.h:553
bool return_counts
Definition: transform.h:552
bool sorted
Definition: transform.h:551