tvm
transform.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
24 #ifndef TVM_RELAY_ATTRS_TRANSFORM_H_
25 #define TVM_RELAY_ATTRS_TRANSFORM_H_
26 
27 #include <tvm/ir/attrs.h>
28 #include <tvm/relay/base.h>
29 #include <tvm/relay/expr.h>
30 #include <tvm/tir/index_map.h>
31 
32 #include <string>
33 
34 namespace tvm {
35 namespace relay {
36 
38 struct SlidingWindowAttrs : public tvm::AttrsNode<SlidingWindowAttrs> {
39  int axis;
42  TVM_DECLARE_ATTRS(SlidingWindowAttrs, "relay.attrs.SlidingWindowAttrs") {
43  TVM_ATTR_FIELD(axis).describe(
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"
47  "number of strides):"
48  "window shape and strides must both be of length"
49  "`data.ndim-axis`.");
50  TVM_ATTR_FIELD(window_shape)
51  .describe(
52  "The window shape to form over the input."
53  "Window shape must be of length `data.ndim-axis`.");
54  TVM_ATTR_FIELD(strides).describe(
55  "How to stride the window along each dimension."
56  "Strides must be of length `data.ndim-axis`.");
57  }
58 }; // struct SlidingWindowAttrs
59 
61 struct CastAttrs : public tvm::AttrsNode<CastAttrs> {
63 
64  TVM_DECLARE_ATTRS(CastAttrs, "relay.attrs.CastAttrs") {
65  TVM_ATTR_FIELD(dtype).describe("Target data type");
66  }
67 }; // struct CastAttrs.
68 
70 struct ExpandDimsAttrs : public tvm::AttrsNode<ExpandDimsAttrs> {
71  int axis;
73 
74  TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs") {
75  TVM_ATTR_FIELD(axis).describe(
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.");
80  TVM_ATTR_FIELD(num_newaxis)
81  .describe("Number of axes to be inserted. Should be >= 0.")
82  .set_lower_bound(0)
83  .set_default(1);
84  }
85 }; // struct ExpandDimsAttrs
86 
88 struct DynExpandDimsAttrs : public tvm::AttrsNode<DynExpandDimsAttrs> {
90 
91  TVM_DECLARE_ATTRS(DynExpandDimsAttrs, "relay.attrs.DynExpandDimsAttrs") {
92  TVM_ATTR_FIELD(num_newaxis)
93  .describe("Number of axes to be inserted. Should be >= 0.")
94  .set_lower_bound(0)
95  .set_default(1);
96  }
97 }; // struct ExpandDimsAttrs
98 
100 struct ConcatenateAttrs : public tvm::AttrsNode<ConcatenateAttrs> {
101  int axis;
102  TVM_DECLARE_ATTRS(ConcatenateAttrs, "relay.attrs.ConcatenateAttrs") {
103  TVM_ATTR_FIELD(axis)
104  .describe(
105  "The axis at which the input arrays are concatenated."
106  "Should lie in range `[-ndim, ndim)`.")
107  .set_default(0);
108  }
109 }; // struct ConcatenateAttrs
110 
112 struct TransposeAttrs : public tvm::AttrsNode<TransposeAttrs> {
114  TVM_DECLARE_ATTRS(TransposeAttrs, "relay.attrs.TransposeAttrs") {
115  TVM_ATTR_FIELD(axes).describe("The target axes order, reverse order if not specified.");
116  }
117 }; // struct TransposeAttrs
118 
120 struct ReshapeAttrs : public tvm::AttrsNode<ReshapeAttrs> {
122  bool allowzero;
123  TVM_DECLARE_ATTRS(ReshapeAttrs, "relay.attrs.ReshapeAttrs") {
124  TVM_ATTR_FIELD(newshape).describe(
125  "The new shape. Should be compatible with the original shape.");
126  TVM_ATTR_FIELD(allowzero).set_default(0).describe(
127  "Whether to honor the value of zero in newshape.");
128  }
129 }; // struct ReshapeAttrs
130 
132 struct ReshapeLikeAttrs : public tvm::AttrsNode<ReshapeLikeAttrs> {
134  Integer lhs_end; // can be None
136  Integer rhs_end; // can be None
137  TVM_DECLARE_ATTRS(ReshapeLikeAttrs, "relay.attrs.ReshapeLikeAttrs") {
138  TVM_ATTR_FIELD(lhs_begin).set_default(0).describe(
139  "The axis of the input where reshaping should begin.");
140  TVM_ATTR_FIELD(lhs_end)
141  .set_default(NullValue<Integer>())
142  .describe("The axis of the input where reshaping should end, exclusive.");
143  TVM_ATTR_FIELD(rhs_begin).set_default(0).describe(
144  "The axis of the shape_like tensor to begin taking dimensions from.");
145  TVM_ATTR_FIELD(rhs_end)
146  .set_default(NullValue<Integer>())
147  .describe("The axis of the shape_like tensor to end taking dimensions from, exclusive.");
148  }
149 }; // struct ReshapeLikeAttrs
150 
151 struct ScatterAttrs : public tvm::AttrsNode<ScatterAttrs> {
153 
154  TVM_DECLARE_ATTRS(ScatterAttrs, "relay.attrs.ScatterAttrs") {
155  TVM_ATTR_FIELD(axis).set_default(0).describe("The axis over which to select values.");
156  }
157 };
158 
159 struct ScatterAddAttrs : public tvm::AttrsNode<ScatterAddAttrs> {
161 
162  TVM_DECLARE_ATTRS(ScatterAddAttrs, "relay.attrs.ScatterAddAttrs") {
163  TVM_ATTR_FIELD(axis).set_default(0).describe("The axis over which to select values.");
164  }
165 };
166 
167 struct ScatterNDAttrs : public tvm::AttrsNode<ScatterNDAttrs> {
169 
170  TVM_DECLARE_ATTRS(ScatterNDAttrs, "relay.attrs.ScatterNDAttrs") {
171  TVM_ATTR_FIELD(mode).describe(
172  "Accumulation mode of the scatter, either \"update\" or \"add\".");
173  }
174 };
175 
176 struct GatherAttrs : public tvm::AttrsNode<GatherAttrs> {
178 
179  TVM_DECLARE_ATTRS(GatherAttrs, "relay.attrs.GatherAttrs") {
180  TVM_ATTR_FIELD(axis)
181  .set_default(NullValue<Integer>())
182  .describe("The axis over which to select values.");
183  }
184 };
185 
186 struct GatherNDAttrs : public tvm::AttrsNode<GatherNDAttrs> {
189 
190  TVM_DECLARE_ATTRS(GatherNDAttrs, "relay.attrs.GatherNDAttrs") {
191  TVM_ATTR_FIELD(batch_dims).set_default(Integer(0)).describe("The number of batch dimensions.");
192  TVM_ATTR_FIELD(index_rank)
193  .set_default(NullValue<Integer>())
194  .describe(
195  "The size of an indexing tuple, which is a fixed value. Only needed when the number of "
196  "indexting tuples is dynamic.");
197  }
198 };
199 
200 struct TakeAttrs : public tvm::AttrsNode<TakeAttrs> {
204 
205  TVM_DECLARE_ATTRS(TakeAttrs, "relay.attrs.TakeAttrs") {
206  TVM_ATTR_FIELD(batch_dims)
207  .set_default(0)
208  .describe("The batch_dims over which to select values.");
209  TVM_ATTR_FIELD(axis)
210  .set_default(NullValue<Integer>())
211  .describe("The axis over which to select values.");
212  TVM_ATTR_FIELD(mode).set_default("clip").describe(
213  "Specify how out-of-bound indices will behave."
214  "clip - clip to the range (default)"
215  "wrap - wrap around the indices"
216  "fast - no clip or wrap around (user must make sure indices are in-bound)");
217  }
218 };
219 
221 struct InitOpAttrs : public tvm::AttrsNode<InitOpAttrs> {
224 
225  TVM_DECLARE_ATTRS(InitOpAttrs, "relay.attrs.InitOpAttrs") {
226  TVM_ATTR_FIELD(shape).describe("Target shape.");
227  TVM_ATTR_FIELD(dtype).describe("Target data type.").set_default(NullValue<DataType>());
228  }
229 }; // struct InitOpAttrs
230 
232 struct ArangeAttrs : public tvm::AttrsNode<ArangeAttrs> {
237 
238  TVM_DECLARE_ATTRS(ArangeAttrs, "relay.attrs.ArangeAttrs") {
239  TVM_ATTR_FIELD(start).describe("Start of interval. The interval includes this value.");
240  TVM_ATTR_FIELD(stop).describe("Stop of interval. The interval does not include this value.");
241  TVM_ATTR_FIELD(step).describe("Spacing between values.");
242  TVM_ATTR_FIELD(dtype).describe("Target data type.");
243  }
244 }; // struct ArangeAttrs
245 
247 struct MeshgridAttrs : public tvm::AttrsNode<MeshgridAttrs> {
248  std::string indexing;
249 
250  TVM_DECLARE_ATTRS(MeshgridAttrs, "relay.attrs.MeshgridAttrs") {
251  TVM_ATTR_FIELD(indexing)
252  .describe(
253  "Indexing mode, either \"ij\" for matrix or \"xy\" for cartesian in which first two"
254  "dimensions are swapped.")
255  .set_default("ij");
256  }
257 }; // struct MeshgridAttrs
258 
260 struct StackAttrs : public tvm::AttrsNode<StackAttrs> {
262  TVM_DECLARE_ATTRS(StackAttrs, "relay.attrs.StackAttrs") {
263  TVM_ATTR_FIELD(axis).set_default(0).describe(
264  "The axis in the result array along which the input arrays are stacked.");
265  }
266 }; // struct StackAttrs
267 
269 struct RepeatAttrs : public tvm::AttrsNode<RepeatAttrs> {
272  TVM_DECLARE_ATTRS(RepeatAttrs, "relay.attrs.RepeatAttrs") {
273  TVM_ATTR_FIELD(repeats).describe("The number of repetitions for each element.");
274  TVM_ATTR_FIELD(axis)
275  .set_default(NullValue<Integer>())
276  .describe(" The axis along which to repeat values.");
277  }
278 }; // struct RepeatAttrs
279 
281 struct TileAttrs : public tvm::AttrsNode<TileAttrs> {
283  TVM_DECLARE_ATTRS(TileAttrs, "relay.attrs.TileAttrs") {
284  TVM_ATTR_FIELD(reps).describe(
285  "The number of times for repeating the tensor a."
286  "Each dim sizeof reps must be a positive integer.");
287  }
288 }; // struct TileAttrs
289 
291 struct ReverseAttrs : public tvm::AttrsNode<ReverseAttrs> {
293  TVM_DECLARE_ATTRS(ReverseAttrs, "relay.attrs.ReverseAttrs") {
294  TVM_ATTR_FIELD(axis)
295  .set_default(NullValue<Integer>())
296  .describe("The axis along which to reverse elements.");
297  }
298 }; // struct ReverseAttrs
299 
301 struct ReverseSequenceAttrs : public tvm::AttrsNode<ReverseSequenceAttrs> {
304 
305  TVM_DECLARE_ATTRS(ReverseSequenceAttrs, "relay.attrs.ReverseSequenceAttrs") {
306  TVM_ATTR_FIELD(seq_axis).set_default(1).describe(
307  "The seq axis along which to reverse elements.");
308  TVM_ATTR_FIELD(batch_axis)
309  .set_default(0)
310  .describe("The batch axis along which to slice the tensor.");
311  }
312 }; // struct ReverseSequenceAttrs
313 
315 struct SqueezeAttrs : public tvm::AttrsNode<SqueezeAttrs> {
316  // use axis to make the name numpy compatible.
318 
319  TVM_DECLARE_ATTRS(SqueezeAttrs, "relay.attrs.SqueezeAttrs") {
320  TVM_ATTR_FIELD(axis)
321  .describe(
322  "The axis to squeeze in the input tensor."
323  "If `axis = None`, all axis of dimension 1 get squeezed;"
324  "Else, the dimension in axes get squeezed."
325  "It is an error if an axis does not has dimension 1.")
326  .set_default(NullValue<Array<Integer>>());
327  }
328 }; // struct SqueezeAttrs
329 
330 struct SplitAttrs : public tvm::AttrsNode<SplitAttrs> {
332  int axis;
333 
334  TVM_DECLARE_ATTRS(SplitAttrs, "relay.attrs.SplitAttrs") {
335  TVM_ATTR_FIELD(indices_or_sections)
336  .describe(
337  "Indices or sections to split into. Accepts an int or a tuple"
338  "If indices_or_sections is an integer, the input will be divided equally"
339  "along given axis. If such a split is not possible, an error is raised."
340  "If indices_or_sections is a tuple of sorted integers,"
341  "the entries indicate where along axis the array is split.");
342  TVM_ATTR_FIELD(axis).set_default(0).describe("the axis to be splitted.");
343  }
344 };
345 
347 struct StridedSliceAttrs : public tvm::AttrsNode<StridedSliceAttrs> {
353 
354  TVM_DECLARE_ATTRS(StridedSliceAttrs, "relay.attrs.StridedSliceAttrs") {
355  TVM_ATTR_FIELD(begin).describe("Indices for begin of slice, begin index is also inclusive");
356  TVM_ATTR_FIELD(end).describe("Indices for end of slice, end index is exclusive");
357  TVM_ATTR_FIELD(strides).describe(
358  "Stride values of the slice, a stride can be negative, which causes a reverse slice.");
359  TVM_ATTR_FIELD(slice_mode)
360  .set_default("end")
361  .describe(
362  "The slice mode [end, size]."
363  "end - The default slice mode, ending indices for the slice."
364  "size - The input strides will be ignored, input end in this mode indicates the size"
365  "of a slice starting at the location specified by begin. If end[i] is -1,"
366  "all remaining elements in that dimension are included in the slice");
367  TVM_ATTR_FIELD(axes).describe(
368  "Axes along which slicing is applied. When it is specified, the length of begin, end, "
369  "strides, and axes must be equal.");
370  }
371 };
372 
373 struct SliceLikeAttrs : public tvm::AttrsNode<SliceLikeAttrs> {
375 
376  TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs") {
377  TVM_ATTR_FIELD(axes).describe(
378  "List of axes on which input data will be sliced according to the "
379  "corresponding size of the second input. By default will slice "
380  "on all axes. Negative axes mean counting in reverse.");
381  }
382 };
383 
385 struct ClipAttrs : public tvm::AttrsNode<ClipAttrs> {
386  double a_min;
387  double a_max;
388 
389  TVM_DECLARE_ATTRS(ClipAttrs, "relay.attrs.ClipAttrs") {
390  TVM_ATTR_FIELD(a_min).describe("The minimum clip value.");
391  TVM_ATTR_FIELD(a_max).describe("The maximum clip value.");
392  }
393 };
394 
396 struct FixedPointMultiplyAttrs : public tvm::AttrsNode<FixedPointMultiplyAttrs> {
397  int32_t multiplier;
398  int32_t shift;
399 
400  TVM_DECLARE_ATTRS(FixedPointMultiplyAttrs, "relay.attrs.FixedPointMultiplyAttrs") {
401  TVM_ATTR_FIELD(multiplier)
402  .describe("Multiplier of a fixed floating point number described as multiplier*2^(shift)");
403  TVM_ATTR_FIELD(shift).describe(
404  "Shift of a fixed floating point number described as multiplier*2^(shift)");
405  }
406 };
407 
409 struct LayoutTransformAttrs : public tvm::AttrsNode<LayoutTransformAttrs> {
410  std::string src_layout;
411  std::string dst_layout;
412 
413  TVM_DECLARE_ATTRS(LayoutTransformAttrs, "relay.attrs.LayoutTransformAttrs") {
414  TVM_ATTR_FIELD(src_layout).describe("The source layout of the tensor. (e.g. NCHW)");
415  TVM_ATTR_FIELD(dst_layout).describe("The destination layout of the tensor. (e.g. NCHW16c)");
416  }
417 };
418 
421  : public tvm::AttrsNode<AutoSchedulerLayoutTransformAttrs> {
422  std::string src_layout;
423  std::string dst_layout;
424 
426  "relay.attrs.AutoSchedulerLayoutTransformAttrs") {
427  TVM_ATTR_FIELD(src_layout).describe("The source layout of the tensor. (e.g. 1N32C112H112W)");
428  TVM_ATTR_FIELD(dst_layout)
429  .describe("The destination layout of the tensor. (e.g. 1N2C112H112W16c)");
430  }
431 };
432 
434 struct MetaScheduleLayoutTransformAttrs : public tvm::AttrsNode<MetaScheduleLayoutTransformAttrs> {
436 
438  "relay.attrs.MetaScheduleLayoutTransformAttrs") {
439  TVM_ATTR_FIELD(index_map).describe(
440  "The order of the extents, for example, "
441  "let extents = [2, 3, 4], reorder = [0, 2, 1], and the shape of buffer A is (4, 6)"
442  "then A[i, j] will be first rewritten to "
443  "A[(6 * i + j) / 12, (6 * i + j) / 4 % 3 , (6 * i + j) % 4] according to the `extents`,"
444  "and then reordered to A[(6 * i + j) / 12, (6 * i + j) % 4 , (6 * i + j) / 4 % 3]"
445  "according to `reorder`");
446  }
447 };
448 
450 struct ShapeOfAttrs : public tvm::AttrsNode<ShapeOfAttrs> {
452 
453  TVM_DECLARE_ATTRS(ShapeOfAttrs, "relay.attrs.ShapeOfAttrs") {
454  TVM_ATTR_FIELD(dtype).describe("Target data type").set_default(NullValue<DataType>());
455  }
456 };
457 
458 struct SequenceMaskAttrs : public tvm::AttrsNode<SequenceMaskAttrs> {
459  double mask_value;
460  int axis;
461 
462  TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs") {
463  TVM_ATTR_FIELD(mask_value).set_default(0).describe("The masking value.");
464  TVM_ATTR_FIELD(axis).set_default(0).describe(
465  "The axis of the length dimension. Can only be 0 or 1.");
466  }
467 }; // struct SequenceMaskAttrs.
468 
470 struct SparseToDenseAttrs : public tvm::AttrsNode<SparseToDenseAttrs> {
472 
473  TVM_DECLARE_ATTRS(SparseToDenseAttrs, "relay.attrs.SparseToDenseAttrs") {
474  TVM_ATTR_FIELD(output_shape).describe("Shape of the dense output tensor");
475  }
476 }; // struct SparseToDenseAttrs
477 
479 struct NdarraySizeAttrs : public tvm::AttrsNode<NdarraySizeAttrs> {
481 
482  TVM_DECLARE_ATTRS(NdarraySizeAttrs, "relay.attrs.NdarraySizeAttrs") {
483  TVM_ATTR_FIELD(dtype).describe("Target data type").set_default(NullValue<DataType>());
484  }
485 };
486 
488 struct OneHotAttrs : public tvm::AttrsNode<OneHotAttrs> {
489  int depth;
490  int axis;
492 
493  TVM_DECLARE_ATTRS(OneHotAttrs, "relay.attrs.OneHotAttrs") {
494  TVM_ATTR_FIELD(depth).set_default(1).describe("Depth of the one hot dimension.");
495  TVM_ATTR_FIELD(axis).set_default(-1).describe("Axis to fill.");
496  TVM_ATTR_FIELD(dtype).set_default(NullValue<DataType>()).describe("Output data type.");
497  }
498 }; // struct OneHotAttrs
499 
501 struct MatrixSetDiagAttrs : public tvm::AttrsNode<MatrixSetDiagAttrs> {
502  int k1;
503  int k2;
506 
507  TVM_DECLARE_ATTRS(MatrixSetDiagAttrs, "relay.attrs.MatrixSetDiagAttrs") {
508  TVM_ATTR_FIELD(k1).set_default(0).describe("Lower limit (included) of the range of diagonals.");
509  TVM_ATTR_FIELD(k2).set_default(0).describe("Upper limit (included) of the range of diagonals.");
510  TVM_ATTR_FIELD(super_diag_right_align)
511  .set_default(true)
512  .describe("Bool, true iff super-diagonal is right aligned (left-padded).");
513  TVM_ATTR_FIELD(sub_diag_right_align)
514  .set_default(false)
515  .describe("Bool, true iff sub-diagonal is right aligned (left-padded).");
516  }
517 }; // struct MatrixSetDiagAttrs
518 
520 struct ScanopAttrs : public tvm::AttrsNode<ScanopAttrs> {
523  Bool exclusive = Bool(false);
524  TVM_DECLARE_ATTRS(ScanopAttrs, "relay.attrs.ScanopAttrs") {
525  TVM_ATTR_FIELD(axis).describe("The axis to operate over").set_default(NullValue<Integer>());
526  TVM_ATTR_FIELD(dtype).describe("Output data type").set_default(NullValue<DataType>());
527 
528  // Default is 0 which is "false"
529  TVM_ATTR_FIELD(exclusive)
530  .describe("The first element is not included")
531  .set_default(Bool(false));
532  }
533 }; // struct ScanopAttrs
534 
536 struct UniqueAttrs : public tvm::AttrsNode<UniqueAttrs> {
537  bool sorted;
539  TVM_DECLARE_ATTRS(UniqueAttrs, "relay.attrs.UniqueAttrs") {
540  TVM_ATTR_FIELD(sorted).describe("Whether the unique elements are sorted").set_default(true);
541  TVM_ATTR_FIELD(return_counts)
542  .describe("Whether to return an additional tensor with counts of each unique elements")
543  .set_default(false);
544  }
545 }; // struct UniqueAttrs
546 
548 struct EinsumAttrs : public tvm::AttrsNode<EinsumAttrs> {
550 
551  TVM_DECLARE_ATTRS(EinsumAttrs, "relay.attrs.EinsumAttrs") {
552  TVM_ATTR_FIELD(equation).describe("The einsum expression string");
553  }
554 }; // struct EinsumAttrs
555 
557 struct StftAttrs : public tvm::AttrsNode<StftAttrs> {
558  int n_fft;
562  bool onesided;
563 
564  TVM_DECLARE_ATTRS(StftAttrs, "relay.attrs.StftAttrs") {
565  TVM_ATTR_FIELD(n_fft).set_default(-1).describe("The size of Fourier transform");
566  TVM_ATTR_FIELD(hop_length)
567  .set_default(-1)
568  .describe("The distance between neighboring sliding window frames");
569  TVM_ATTR_FIELD(win_length).set_default(-1).describe("The size of window frame and STFT filter");
570  TVM_ATTR_FIELD(normalized)
571  .set_default(false)
572  .describe("Whether to return the normalized STFT results");
573  TVM_ATTR_FIELD(onesided).set_default(true).describe(
574  "Whether to return onesided result or fill with conjugate symmetry");
575  }
576 }; // struct StftAttrs
577 
578 struct TriluAttrs : public tvm::AttrsNode<TriluAttrs> {
579  bool upper;
580 
581  TVM_DECLARE_ATTRS(TriluAttrs, "relay.attrs.TriluAttrs") {
582  TVM_ATTR_FIELD(upper).set_default(true).describe(
583  "Whether to keep the upper or lower half of the diagonal.");
584  }
585 }; // struct TriluAttrs
586 
587 } // namespace relay
588 } // namespace tvm
589 #endif // TVM_RELAY_ATTRS_TRANSFORM_H_
DataType dtype
Definition: transform.h:223
std::string dst_layout
Definition: transform.h:423
int rhs_begin
Definition: transform.h:135
Attributes used in stft operator.
Definition: transform.h:557
double a_max
Definition: transform.h:387
TVM_DECLARE_ATTRS(ReshapeLikeAttrs, "relay.attrs.ReshapeLikeAttrs")
Definition: transform.h:137
Integer axis
Definition: transform.h:292
TVM_DECLARE_ATTRS(StridedSliceAttrs, "relay.attrs.StridedSliceAttrs")
Definition: transform.h:354
Array< Integer > axes
Definition: transform.h:374
int lhs_begin
Definition: transform.h:133
TVM_DECLARE_ATTRS(MatrixSetDiagAttrs, "relay.attrs.MatrixSetDiagAttrs")
Definition: transform.h:507
data type cast
Definition: transform.h:61
Boolean constant.
Definition: expr.h:583
Attributes for FixedPointMultiply operator.
Definition: transform.h:396
int axis
Definition: transform.h:71
bool allowzero
Definition: transform.h:122
TVM_DECLARE_ATTRS(NdarraySizeAttrs, "relay.attrs.NdarraySizeAttrs")
Definition: transform.h:482
TVM_DECLARE_ATTRS(ReshapeAttrs, "relay.attrs.ReshapeAttrs")
Definition: transform.h:123
TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs")
Definition: transform.h:74
TVM_DECLARE_ATTRS(LayoutTransformAttrs, "relay.attrs.LayoutTransformAttrs")
Definition: transform.h:413
std::string src_layout
Definition: transform.h:410
int axis
Definition: transform.h:490
Attributes used in expand_dims operators.
Definition: transform.h:70
Relay expression language.
Attributes used in matrix_set_diag operator.
Definition: transform.h:501
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Array< Integer > axes
Definition: transform.h:113
TVM_DECLARE_ATTRS(DynExpandDimsAttrs, "relay.attrs.DynExpandDimsAttrs")
Definition: transform.h:91
Attributes used in unique operator.
Definition: transform.h:536
DataType dtype
Definition: transform.h:491
int axis
Definition: transform.h:332
DataType dtype
Definition: transform.h:62
TVM_DECLARE_ATTRS(ShapeOfAttrs, "relay.attrs.ShapeOfAttrs")
Definition: transform.h:453
Attributes that specify a tensor.
Definition: transform.h:221
int axis
Definition: transform.h:460
Integer repeats
Definition: transform.h:270
Definition: transform.h:151
TVM_DECLARE_ATTRS(StackAttrs, "relay.attrs.StackAttrs")
Definition: transform.h:262
Array< Integer > newshape
Definition: transform.h:121
Definition: transform.h:186
Attributes used in transpose operators.
Definition: transform.h:112
Attributes used in one-hot operator.
Definition: transform.h:488
int32_t multiplier
Definition: transform.h:397
TVM_DECLARE_ATTRS(ConcatenateAttrs, "relay.attrs.ConcatenateAttrs")
Definition: transform.h:102
Definition: transform.h:176
Attributes for Clip operator.
Definition: transform.h:385
Definition: transform.h:159
int num_newaxis
Definition: transform.h:72
TVM_DECLARE_ATTRS(TileAttrs, "relay.attrs.TileAttrs")
Definition: transform.h:283
Attributes for StridedSlice operator.
Definition: transform.h:347
Optional< Array< Integer > > begin
Definition: transform.h:348
TVM_DECLARE_ATTRS(ClipAttrs, "relay.attrs.ClipAttrs")
Definition: transform.h:389
TVM_DECLARE_ATTRS(UniqueAttrs, "relay.attrs.UniqueAttrs")
Definition: transform.h:539
Helpers for attribute objects.
ObjectRef indices_or_sections
Definition: transform.h:331
Integer batch_dims
Definition: transform.h:187
Definition: transform.h:373
tvm::String slice_mode
Definition: transform.h:351
Optional< Array< Integer > > shape
Definition: transform.h:222
Attributes used in MXNet-style reshape_like operators.
Definition: transform.h:132
Defines a remapping of buffer indices.
Attributes used in dynamic expand_dims operators.
Definition: transform.h:88
TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs")
Definition: transform.h:462
Array< Integer > window_shape
Definition: transform.h:40
Expr start
Definition: transform.h:233
TVM_DECLARE_ATTRS(EinsumAttrs, "relay.attrs.EinsumAttrs")
Definition: transform.h:551
Attributes used in einsum operator.
Definition: transform.h:548
String equation
Definition: transform.h:549
Attributes used in cumsum and cumprod operator.
Definition: transform.h:520
TVM_DECLARE_ATTRS(SparseToDenseAttrs, "relay.attrs.SparseToDenseAttrs")
Definition: transform.h:473
Integer batch_dims
Definition: transform.h:201
tvm::String mode
Definition: transform.h:203
Runtime primitive data type.
Definition: data_type.h:41
Attributes for LayoutTransform operator.
Definition: transform.h:409
Attributes used in arange operators.
Definition: transform.h:232
TVM_DECLARE_ATTRS(GatherNDAttrs, "relay.attrs.GatherNDAttrs")
Definition: transform.h:190
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Definition: index_map.h:167
Attributes used in reverse operators.
Definition: transform.h:291
TVM_DECLARE_ATTRS(ScatterAttrs, "relay.attrs.ScatterAttrs")
Definition: transform.h:154
Definition: transform.h:330
int axis
Definition: transform.h:39
TVM_DECLARE_ATTRS(ReverseAttrs, "relay.attrs.ReverseAttrs")
Definition: transform.h:293
double a_min
Definition: transform.h:386
int depth
Definition: transform.h:489
Attributes used in meshgrid operators.
Definition: transform.h:247
DataType dtype
Definition: transform.h:522
TVM_DECLARE_ATTRS(GatherAttrs, "relay.attrs.GatherAttrs")
Definition: transform.h:179
#define TVM_ATTR_FIELD(FieldName)
Declare an attribute field.
Definition: attrs.h:76
TVM_DECLARE_ATTRS(ArangeAttrs, "relay.attrs.ArangeAttrs")
Definition: transform.h:238
Attributes used in tile operators.
Definition: transform.h:281
DataType dtype
Definition: transform.h:236
bool sorted
Definition: transform.h:537
Reference to string objects.
Definition: string.h:97
Definition: transform.h:578
String mode
Definition: transform.h:168
TVM_DECLARE_ATTRS(InitOpAttrs, "relay.attrs.InitOpAttrs")
Definition: transform.h:225
TVM_DECLARE_ATTRS(ScatterAddAttrs, "relay.attrs.ScatterAddAttrs")
Definition: transform.h:162
Managed reference to RelayExprNode.
Definition: expr.h:431
Attributes for MetaScheduleLayoutTransform operator.
Definition: transform.h:434
Expr stop
Definition: transform.h:234
Array< Integer > strides
Definition: transform.h:41
Integer lhs_end
Definition: transform.h:134
TVM_DECLARE_ATTRS(AutoSchedulerLayoutTransformAttrs, "relay.attrs.AutoSchedulerLayoutTransformAttrs")
Definition: transform.h:425
TVM_DECLARE_ATTRS(SqueezeAttrs, "relay.attrs.SqueezeAttrs")
Definition: transform.h:319
TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs")
Definition: transform.h:376
Integer axis
Definition: transform.h:521
Array< Integer > reps
Definition: transform.h:282
bool normalized
Definition: transform.h:561
Integer seq_axis
Definition: transform.h:302
TVM_DECLARE_ATTRS(ScatterNDAttrs, "relay.attrs.ScatterNDAttrs")
Definition: transform.h:170
bool super_diag_right_align
Definition: transform.h:504
bool return_counts
Definition: transform.h:538
TVM_DECLARE_ATTRS(StftAttrs, "relay.attrs.StftAttrs")
Definition: transform.h:564
Base class of all object reference.
Definition: object.h:511
DataType NullValue< DataType >()
Definition: attrs.h:90
Integer axis
Definition: transform.h:152
TVM_DECLARE_ATTRS(CastAttrs, "relay.attrs.CastAttrs")
Definition: transform.h:64
Attributes used in sparse_to_dense operator.
Definition: transform.h:470
std::string indexing
Definition: transform.h:248
int num_newaxis
Definition: transform.h:89
TVM_DECLARE_ATTRS(SlidingWindowAttrs, "relay.attrs.SlidingWindowAttrs")
Definition: transform.h:42
std::string src_layout
Definition: transform.h:422
TVM_DECLARE_ATTRS(TransposeAttrs, "relay.attrs.TransposeAttrs")
Definition: transform.h:114
bool onesided
Definition: transform.h:562
TVM_DECLARE_ATTRS(SplitAttrs, "relay.attrs.SplitAttrs")
Definition: transform.h:334
Attributes for ndarray_size operator.
Definition: transform.h:479
Optional< Array< Integer > > axes
Definition: transform.h:352
Definition: transform.h:167
TVM_DECLARE_ATTRS(MeshgridAttrs, "relay.attrs.MeshgridAttrs")
Definition: transform.h:250
Attributes used in stack operators.
Definition: transform.h:260
int32_t shift
Definition: transform.h:398
Definition: transform.h:200
Attributes used for the sliding_window operator.
Definition: transform.h:38
double mask_value
Definition: transform.h:459
DataType dtype
Definition: transform.h:480
The base class of the all the Use "curiously recurring template pattern".
Definition: attrs.h:834
DataType dtype
Definition: transform.h:451
bool sub_diag_right_align
Definition: transform.h:505
TVM_DECLARE_ATTRS(ReverseSequenceAttrs, "relay.attrs.ReverseSequenceAttrs")
Definition: transform.h:305
int k1
Definition: transform.h:502
Expr step
Definition: transform.h:235
Attributes used in repeat operators.
Definition: transform.h:269
tir::IndexMap index_map
Definition: transform.h:435
Optional< Array< Integer > > strides
Definition: transform.h:350
Attributes used in squeeze operators.
Definition: transform.h:315
Base classes for the Relay IR.
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
std::string dst_layout
Definition: transform.h:411
Array< Integer > axis
Definition: transform.h:317
int hop_length
Definition: transform.h:559
TVM_DECLARE_ATTRS(RepeatAttrs, "relay.attrs.RepeatAttrs")
Definition: transform.h:272
int axis
Definition: transform.h:101
Attributes for AutoSchedulerLayoutTransform operator.
Definition: transform.h:420
TObjectRef NullValue()
Create a NodeRef type that represents null.
Definition: attrs.h:84
TVM_DECLARE_ATTRS(TakeAttrs, "relay.attrs.TakeAttrs")
Definition: transform.h:205
Definition: transform.h:458
int win_length
Definition: transform.h:560
Integer rhs_end
Definition: transform.h:136
bool upper
Definition: transform.h:579
int n_fft
Definition: transform.h:558
Attributes used in reverse_sequence operators.
Definition: transform.h:301
Attributes used in reshape operators.
Definition: transform.h:120
Optional< Integer > index_rank
Definition: transform.h:188
TVM_DECLARE_ATTRS(OneHotAttrs, "relay.attrs.OneHotAttrs")
Definition: transform.h:493
Integer axis
Definition: transform.h:160
Attributes for ShapeOf operator.
Definition: transform.h:450
Integer axis
Definition: transform.h:177
TVM_DECLARE_ATTRS(ScanopAttrs, "relay.attrs.ScanopAttrs")
Definition: transform.h:524
Array< Integer > output_shape
Definition: transform.h:471
Optional< Array< Integer > > end
Definition: transform.h:349
TVM_DECLARE_ATTRS(MetaScheduleLayoutTransformAttrs, "relay.attrs.MetaScheduleLayoutTransformAttrs")
Definition: transform.h:437
Integer axis
Definition: transform.h:271
Integer axis
Definition: transform.h:261
TVM_DECLARE_ATTRS(FixedPointMultiplyAttrs, "relay.attrs.FixedPointMultiplyAttrs")
Definition: transform.h:400
int k2
Definition: transform.h:503
Attributes used in concatenate operators.
Definition: transform.h:100
Integer batch_axis
Definition: transform.h:303
TVM_DECLARE_ATTRS(TriluAttrs, "relay.attrs.TriluAttrs")
Definition: transform.h:581
Container of constant int that adds more constructors.
Definition: expr.h:618
Integer axis
Definition: transform.h:202