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 
31 #include <string>
32 
33 namespace tvm {
34 namespace relay {
35 
37 struct CastAttrs : public tvm::AttrsNode<CastAttrs> {
39 
40  TVM_DECLARE_ATTRS(CastAttrs, "relay.attrs.CastAttrs") {
41  TVM_ATTR_FIELD(dtype).describe("Target data type");
42  }
43 }; // struct CastAttrs.
44 
46 struct ExpandDimsAttrs : public tvm::AttrsNode<ExpandDimsAttrs> {
47  int axis;
49 
50  TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs") {
51  TVM_ATTR_FIELD(axis).describe(
52  "The axis at which the input array is expanded."
53  "Should lie in range `[-data.ndim - 1, data.ndim]`."
54  "If `axis < 0`, it is the first axis inserted;"
55  "If `axis >= 0`, it is the last axis inserted in Python's negative indexing.");
56  TVM_ATTR_FIELD(num_newaxis)
57  .describe("Number of axes to be inserted. Should be >= 0.")
58  .set_lower_bound(0)
59  .set_default(1);
60  }
61 }; // struct ExpandDimsAttrs
62 
64 struct DynExpandDimsAttrs : public tvm::AttrsNode<DynExpandDimsAttrs> {
66 
67  TVM_DECLARE_ATTRS(DynExpandDimsAttrs, "relay.attrs.DynExpandDimsAttrs") {
68  TVM_ATTR_FIELD(num_newaxis)
69  .describe("Number of axes to be inserted. Should be >= 0.")
70  .set_lower_bound(0)
71  .set_default(1);
72  }
73 }; // struct ExpandDimsAttrs
74 
76 struct ConcatenateAttrs : public tvm::AttrsNode<ConcatenateAttrs> {
77  int axis;
78  TVM_DECLARE_ATTRS(ConcatenateAttrs, "relay.attrs.ConcatenateAttrs") {
79  TVM_ATTR_FIELD(axis)
80  .describe(
81  "The axis at which the input arrays are concatenated."
82  "Should lie in range `[-ndim, ndim)`.")
83  .set_default(0);
84  }
85 }; // struct ConcatenateAttrs
86 
88 struct TransposeAttrs : public tvm::AttrsNode<TransposeAttrs> {
90  TVM_DECLARE_ATTRS(TransposeAttrs, "relay.attrs.TransposeAttrs") {
91  TVM_ATTR_FIELD(axes).describe("The target axes order, reverse order if not specified.");
92  }
93 }; // struct TransposeAttrs
94 
96 struct ReshapeAttrs : public tvm::AttrsNode<ReshapeAttrs> {
98  TVM_DECLARE_ATTRS(ReshapeAttrs, "relay.attrs.ReshapeAttrs") {
99  TVM_ATTR_FIELD(newshape).describe(
100  "The new shape. Should be compatible with the original shape.");
101  }
102 }; // struct ReshapeAttrs
103 
105 struct ReshapeLikeAttrs : public tvm::AttrsNode<ReshapeLikeAttrs> {
107  Integer lhs_end; // can be None
109  Integer rhs_end; // can be None
110  TVM_DECLARE_ATTRS(ReshapeLikeAttrs, "relay.attrs.ReshapeLikeAttrs") {
111  TVM_ATTR_FIELD(lhs_begin).set_default(0).describe(
112  "The axis of the input where reshaping should begin.");
113  TVM_ATTR_FIELD(lhs_end)
114  .set_default(NullValue<Integer>())
115  .describe("The axis of the input where reshaping should end, exclusive.");
116  TVM_ATTR_FIELD(rhs_begin).set_default(0).describe(
117  "The axis of the shape_like tensor to begin taking dimensions from.");
118  TVM_ATTR_FIELD(rhs_end)
119  .set_default(NullValue<Integer>())
120  .describe("The axis of the shape_like tensor to end taking dimensions from, exclusive.");
121  }
122 }; // struct ReshapeLikeAttrs
123 
124 struct ScatterAttrs : public tvm::AttrsNode<ScatterAttrs> {
126 
127  TVM_DECLARE_ATTRS(ScatterAttrs, "relay.attrs.ScatterAttrs") {
128  TVM_ATTR_FIELD(axis).set_default(0).describe("The axis over which to select values.");
129  }
130 };
131 
132 struct ScatterAddAttrs : public tvm::AttrsNode<ScatterAddAttrs> {
134 
135  TVM_DECLARE_ATTRS(ScatterAddAttrs, "relay.attrs.ScatterAddAttrs") {
136  TVM_ATTR_FIELD(axis).set_default(0).describe("The axis over which to select values.");
137  }
138 };
139 
140 struct ScatterNDAttrs : public tvm::AttrsNode<ScatterNDAttrs> {
142 
143  TVM_DECLARE_ATTRS(ScatterNDAttrs, "relay.attrs.ScatterNDAttrs") {
144  TVM_ATTR_FIELD(mode).describe(
145  "Accumulation mode of the scatter, either \"update\" or \"add\".");
146  }
147 };
148 
149 struct GatherAttrs : public tvm::AttrsNode<GatherAttrs> {
151 
152  TVM_DECLARE_ATTRS(GatherAttrs, "relay.attrs.GatherAttrs") {
153  TVM_ATTR_FIELD(axis)
154  .set_default(NullValue<Integer>())
155  .describe("The axis over which to select values.");
156  }
157 };
158 
159 struct GatherNDAttrs : public tvm::AttrsNode<GatherNDAttrs> {
162 
163  TVM_DECLARE_ATTRS(GatherNDAttrs, "relay.attrs.GatherNDAttrs") {
164  TVM_ATTR_FIELD(batch_dims).set_default(Integer(0)).describe("The number of batch dimensions.");
165  TVM_ATTR_FIELD(index_rank)
166  .set_default(NullValue<Integer>())
167  .describe(
168  "The size of an indexing tuple, which is a fixed value. Only needed when the number of "
169  "indexting tuples is dynamic.");
170  }
171 };
172 
173 struct TakeAttrs : public tvm::AttrsNode<TakeAttrs> {
176  std::string mode;
177 
178  TVM_DECLARE_ATTRS(TakeAttrs, "relay.attrs.TakeAttrs") {
179  TVM_ATTR_FIELD(batch_dims)
180  .set_default(0)
181  .describe("The batch_dims over which to select values.");
182  TVM_ATTR_FIELD(axis)
183  .set_default(NullValue<Integer>())
184  .describe("The axis over which to select values.");
185  TVM_ATTR_FIELD(mode).set_default("clip").describe(
186  "Specify how out-of-bound indices will behave."
187  "clip - clip to the range (default)"
188  "wrap - wrap around the indices"
189  "fast - no clip or wrap around (user must make sure indices are in-bound)");
190  }
191 };
192 
194 struct InitOpAttrs : public tvm::AttrsNode<InitOpAttrs> {
197 
198  TVM_DECLARE_ATTRS(InitOpAttrs, "relay.attrs.InitOpAttrs") {
199  TVM_ATTR_FIELD(shape).describe("Target shape.");
200  TVM_ATTR_FIELD(dtype).describe("Target data type.").set_default(NullValue<DataType>());
201  }
202 }; // struct InitOpAttrs
203 
205 struct ArangeAttrs : public tvm::AttrsNode<ArangeAttrs> {
210 
211  TVM_DECLARE_ATTRS(ArangeAttrs, "relay.attrs.ArangeAttrs") {
212  TVM_ATTR_FIELD(start).describe("Start of interval. The interval includes this value.");
213  TVM_ATTR_FIELD(stop).describe("Stop of interval. The interval does not include this value.");
214  TVM_ATTR_FIELD(step).describe("Spacing between values.");
215  TVM_ATTR_FIELD(dtype).describe("Target data type.");
216  }
217 }; // struct ArangeAttrs
218 
220 struct MeshgridAttrs : public tvm::AttrsNode<MeshgridAttrs> {
221  std::string indexing;
222 
223  TVM_DECLARE_ATTRS(MeshgridAttrs, "relay.attrs.MeshgridAttrs") {
224  TVM_ATTR_FIELD(indexing)
225  .describe(
226  "Indexing mode, either \"ij\" for matrix or \"xy\" for cartesian in which first two"
227  "dimensions are swapped.")
228  .set_default("ij");
229  }
230 }; // struct MeshgridAttrs
231 
233 struct StackAttrs : public tvm::AttrsNode<StackAttrs> {
235  TVM_DECLARE_ATTRS(StackAttrs, "relay.attrs.StackAttrs") {
236  TVM_ATTR_FIELD(axis).set_default(0).describe(
237  "The axis in the result array along which the input arrays are stacked.");
238  }
239 }; // struct StackAttrs
240 
242 struct RepeatAttrs : public tvm::AttrsNode<RepeatAttrs> {
245  TVM_DECLARE_ATTRS(RepeatAttrs, "relay.attrs.RepeatAttrs") {
246  TVM_ATTR_FIELD(repeats).describe("The number of repetitions for each element.");
247  TVM_ATTR_FIELD(axis)
248  .set_default(NullValue<Integer>())
249  .describe(" The axis along which to repeat values.");
250  }
251 }; // struct RepeatAttrs
252 
254 struct TileAttrs : public tvm::AttrsNode<TileAttrs> {
256  TVM_DECLARE_ATTRS(TileAttrs, "relay.attrs.TileAttrs") {
257  TVM_ATTR_FIELD(reps).describe(
258  "The number of times for repeating the tensor a."
259  "Each dim sizeof reps must be a positive integer.");
260  }
261 }; // struct TileAttrs
262 
264 struct ReverseAttrs : public tvm::AttrsNode<ReverseAttrs> {
266  TVM_DECLARE_ATTRS(ReverseAttrs, "relay.attrs.ReverseAttrs") {
267  TVM_ATTR_FIELD(axis)
268  .set_default(NullValue<Integer>())
269  .describe("The axis along which to reverse elements.");
270  }
271 }; // struct ReverseAttrs
272 
274 struct ReverseSequenceAttrs : public tvm::AttrsNode<ReverseSequenceAttrs> {
277 
278  TVM_DECLARE_ATTRS(ReverseSequenceAttrs, "relay.attrs.ReverseSequenceAttrs") {
279  TVM_ATTR_FIELD(seq_axis).set_default(1).describe(
280  "The seq axis along which to reverse elements.");
281  TVM_ATTR_FIELD(batch_axis)
282  .set_default(0)
283  .describe("The batch axis along which to slice the tensor.");
284  }
285 }; // struct ReverseSequenceAttrs
286 
288 struct SqueezeAttrs : public tvm::AttrsNode<SqueezeAttrs> {
289  // use axis to make the name numpy compatible.
291 
292  TVM_DECLARE_ATTRS(SqueezeAttrs, "relay.attrs.SqueezeAttrs") {
293  TVM_ATTR_FIELD(axis)
294  .describe(
295  "The axis to squeeze in the input tensor."
296  "If `axis = None`, all axis of dimension 1 get squeezed;"
297  "Else, the dimension in axes get squeezed."
298  "It is an error if an axis does not has dimension 1.")
299  .set_default(NullValue<Array<Integer>>());
300  }
301 }; // struct SqueezeAttrs
302 
303 struct SplitAttrs : public tvm::AttrsNode<SplitAttrs> {
305  int axis;
306 
307  TVM_DECLARE_ATTRS(SplitAttrs, "relay.attrs.SplitAttrs") {
308  TVM_ATTR_FIELD(indices_or_sections)
309  .describe(
310  "Indices or sections to split into. Accepts an int or a tuple"
311  "If indices_or_sections is an integer, the input will be divided equally"
312  "along given axis. If such a split is not possible, an error is raised."
313  "If indices_or_sections is a tuple of sorted integers,"
314  "the entries indicate where along axis the array is split.");
315  TVM_ATTR_FIELD(axis).set_default(0).describe("the axis to be splitted.");
316  }
317 };
318 
320 struct StridedSliceAttrs : public tvm::AttrsNode<StridedSliceAttrs> {
324  std::string slice_mode;
326 
327  TVM_DECLARE_ATTRS(StridedSliceAttrs, "relay.attrs.StridedSliceAttrs") {
328  TVM_ATTR_FIELD(begin).describe("Indices for begin of slice, begin index is also inclusive");
329  TVM_ATTR_FIELD(end).describe("Indices for end of slice, end index is exclusive");
330  TVM_ATTR_FIELD(strides).describe(
331  "Stride values of the slice, a stride can be negative, which causes a reverse slice.");
332  TVM_ATTR_FIELD(slice_mode)
333  .set_default("end")
334  .describe(
335  "The slice mode [end, size]."
336  "end - The default slice mode, ending indices for the slice."
337  "size - The input strides will be ignored, input end in this mode indicates the size"
338  "of a slice starting at the location specified by begin. If end[i] is -1,"
339  "all remaining elements in that dimension are included in the slice");
340  TVM_ATTR_FIELD(axes).describe(
341  "Axes along which slicing is applied. When it is specified, the length of begin, end, "
342  "strides, and axes must be equal.");
343  }
344 };
345 
346 struct SliceLikeAttrs : public tvm::AttrsNode<SliceLikeAttrs> {
348 
349  TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs") {
350  TVM_ATTR_FIELD(axes).describe(
351  "List of axes on which input data will be sliced according to the "
352  "corresponding size of the second input. By default will slice "
353  "on all axes. Negative axes mean counting in reverse.");
354  }
355 };
356 
358 struct ClipAttrs : public tvm::AttrsNode<ClipAttrs> {
359  double a_min;
360  double a_max;
361 
362  TVM_DECLARE_ATTRS(ClipAttrs, "relay.attrs.ClipAttrs") {
363  TVM_ATTR_FIELD(a_min).describe("The minimum clip value.");
364  TVM_ATTR_FIELD(a_max).describe("The maximum clip value.");
365  }
366 };
367 
369 struct FixedPointMultiplyAttrs : public tvm::AttrsNode<FixedPointMultiplyAttrs> {
370  int32_t multiplier;
371  int32_t shift;
372 
373  TVM_DECLARE_ATTRS(FixedPointMultiplyAttrs, "relay.attrs.FixedPointMultiplyAttrs") {
374  TVM_ATTR_FIELD(multiplier)
375  .describe("Multiplier of a fixed floating point number described as multiplier*2^(shift)");
376  TVM_ATTR_FIELD(shift).describe(
377  "Shift of a fixed floating point number described as multiplier*2^(shift)");
378  }
379 };
380 
382 struct LayoutTransformAttrs : public tvm::AttrsNode<LayoutTransformAttrs> {
383  std::string src_layout;
384  std::string dst_layout;
385 
386  TVM_DECLARE_ATTRS(LayoutTransformAttrs, "relay.attrs.LayoutTransformAttrs") {
387  TVM_ATTR_FIELD(src_layout).describe("The source layout of the tensor. (e.g. NCHW)");
388  TVM_ATTR_FIELD(dst_layout).describe("The destination layout of the tensor. (e.g. NCHW16c)");
389  }
390 };
391 
394  : public tvm::AttrsNode<AutoSchedulerLayoutTransformAttrs> {
395  std::string src_layout;
396  std::string dst_layout;
397 
399  "relay.attrs.AutoSchedulerLayoutTransformAttrs") {
400  TVM_ATTR_FIELD(src_layout).describe("The source layout of the tensor. (e.g. 1N32C112H112W)");
401  TVM_ATTR_FIELD(dst_layout)
402  .describe("The destination layout of the tensor. (e.g. 1N2C112H112W16c)");
403  }
404 };
405 
407 struct ShapeOfAttrs : public tvm::AttrsNode<ShapeOfAttrs> {
409 
410  TVM_DECLARE_ATTRS(ShapeOfAttrs, "relay.attrs.ShapeOfAttrs") {
411  TVM_ATTR_FIELD(dtype).describe("Target data type").set_default(NullValue<DataType>());
412  }
413 };
414 
415 struct SequenceMaskAttrs : public tvm::AttrsNode<SequenceMaskAttrs> {
416  double mask_value;
417  int axis;
418 
419  TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs") {
420  TVM_ATTR_FIELD(mask_value).set_default(0).describe("The masking value.");
421  TVM_ATTR_FIELD(axis).set_default(0).describe(
422  "The axis of the length dimension. Can only be 0 or 1.");
423  }
424 }; // struct SequenceMaskAttrs.
425 
427 struct SparseToDenseAttrs : public tvm::AttrsNode<SparseToDenseAttrs> {
429 
430  TVM_DECLARE_ATTRS(SparseToDenseAttrs, "relay.attrs.SparseToDenseAttrs") {
431  TVM_ATTR_FIELD(output_shape).describe("Shape of the dense output tensor");
432  }
433 }; // struct SparseToDenseAttrs
434 
436 struct NdarraySizeAttrs : public tvm::AttrsNode<NdarraySizeAttrs> {
438 
439  TVM_DECLARE_ATTRS(NdarraySizeAttrs, "relay.attrs.NdarraySizeAttrs") {
440  TVM_ATTR_FIELD(dtype).describe("Target data type").set_default(NullValue<DataType>());
441  }
442 };
443 
445 struct OneHotAttrs : public tvm::AttrsNode<OneHotAttrs> {
446  int depth;
447  int axis;
449 
450  TVM_DECLARE_ATTRS(OneHotAttrs, "relay.attrs.OneHotAttrs") {
451  TVM_ATTR_FIELD(depth).set_default(1).describe("Depth of the one hot dimension.");
452  TVM_ATTR_FIELD(axis).set_default(-1).describe("Axis to fill.");
453  TVM_ATTR_FIELD(dtype).set_default(NullValue<DataType>()).describe("Output data type.");
454  }
455 }; // struct OneHotAttrs
456 
458 struct MatrixSetDiagAttrs : public tvm::AttrsNode<MatrixSetDiagAttrs> {
459  int k1;
460  int k2;
463 
464  TVM_DECLARE_ATTRS(MatrixSetDiagAttrs, "relay.attrs.MatrixSetDiagAttrs") {
465  TVM_ATTR_FIELD(k1).set_default(0).describe("Lower limit (included) of the range of diagonals.");
466  TVM_ATTR_FIELD(k2).set_default(0).describe("Upper limit (included) of the range of diagonals.");
467  TVM_ATTR_FIELD(super_diag_right_align)
468  .set_default(true)
469  .describe("Bool, true iff super-diagonal is right aligned (left-padded).");
470  TVM_ATTR_FIELD(sub_diag_right_align)
471  .set_default(false)
472  .describe("Bool, true iff sub-diagonal is right aligned (left-padded).");
473  }
474 }; // struct MatrixSetDiagAttrs
475 
477 struct ScanopAttrs : public tvm::AttrsNode<ScanopAttrs> {
480  Bool exclusive = Bool(false);
481  TVM_DECLARE_ATTRS(ScanopAttrs, "relay.attrs.ScanopAttrs") {
482  TVM_ATTR_FIELD(axis).describe("The axis to operate over").set_default(NullValue<Integer>());
483  TVM_ATTR_FIELD(dtype).describe("Output data type").set_default(NullValue<DataType>());
484 
485  // Default is 0 which is "false"
486  TVM_ATTR_FIELD(exclusive)
487  .describe("The first element is not included")
488  .set_default(Bool(false));
489  }
490 }; // struct ScanopAttrs
491 
493 struct UniqueAttrs : public tvm::AttrsNode<UniqueAttrs> {
494  bool sorted;
496  TVM_DECLARE_ATTRS(UniqueAttrs, "relay.attrs.UniqueAttrs") {
497  TVM_ATTR_FIELD(sorted).describe("Whether the unique elements are sorted").set_default(true);
498  TVM_ATTR_FIELD(return_counts)
499  .describe("Whether to return an additional tensor with counts of each unique elements")
500  .set_default(false);
501  }
502 }; // struct UniqueAttrs
503 
505 struct EinsumAttrs : public tvm::AttrsNode<EinsumAttrs> {
507 
508  TVM_DECLARE_ATTRS(EinsumAttrs, "relay.attrs.EinsumAttrs") {
509  TVM_ATTR_FIELD(equation).describe("The einsum expression string");
510  }
511 }; // struct EinsumAttrs
512 
513 } // namespace relay
514 } // namespace tvm
515 #endif // TVM_RELAY_ATTRS_TRANSFORM_H_
DataType dtype
Definition: transform.h:196
std::string dst_layout
Definition: transform.h:396
int rhs_begin
Definition: transform.h:108
double a_max
Definition: transform.h:360
TVM_DECLARE_ATTRS(ReshapeLikeAttrs, "relay.attrs.ReshapeLikeAttrs")
Definition: transform.h:110
Integer axis
Definition: transform.h:265
TVM_DECLARE_ATTRS(StridedSliceAttrs, "relay.attrs.StridedSliceAttrs")
Definition: transform.h:327
Array< Integer > axes
Definition: transform.h:347
int lhs_begin
Definition: transform.h:106
TVM_DECLARE_ATTRS(MatrixSetDiagAttrs, "relay.attrs.MatrixSetDiagAttrs")
Definition: transform.h:464
data type cast
Definition: transform.h:37
Boolean constant.
Definition: expr.h:327
Attributes for FixedPointMultiply operator.
Definition: transform.h:369
int axis
Definition: transform.h:47
TVM_DECLARE_ATTRS(NdarraySizeAttrs, "relay.attrs.NdarraySizeAttrs")
Definition: transform.h:439
TVM_DECLARE_ATTRS(ReshapeAttrs, "relay.attrs.ReshapeAttrs")
Definition: transform.h:98
TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs")
Definition: transform.h:50
std::string mode
Definition: transform.h:176
TVM_DECLARE_ATTRS(LayoutTransformAttrs, "relay.attrs.LayoutTransformAttrs")
Definition: transform.h:386
std::string src_layout
Definition: transform.h:383
int axis
Definition: transform.h:447
Attributes used in expand_dims operators.
Definition: transform.h:46
Relay expression language.
Attributes used in matrix_set_diag operator.
Definition: transform.h:458
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
Array< Integer > axes
Definition: transform.h:89
TVM_DECLARE_ATTRS(DynExpandDimsAttrs, "relay.attrs.DynExpandDimsAttrs")
Definition: transform.h:67
Attributes used in unique operator.
Definition: transform.h:493
DataType dtype
Definition: transform.h:448
int axis
Definition: transform.h:305
DataType dtype
Definition: transform.h:38
TVM_DECLARE_ATTRS(ShapeOfAttrs, "relay.attrs.ShapeOfAttrs")
Definition: transform.h:410
Attributes that specify a tensor.
Definition: transform.h:194
int axis
Definition: transform.h:417
Integer repeats
Definition: transform.h:243
Definition: transform.h:124
TVM_DECLARE_ATTRS(StackAttrs, "relay.attrs.StackAttrs")
Definition: transform.h:235
Array< Integer > newshape
Definition: transform.h:97
Definition: transform.h:159
Attributes used in transpose operators.
Definition: transform.h:88
Attributes used in one-hot operator.
Definition: transform.h:445
int32_t multiplier
Definition: transform.h:370
TVM_DECLARE_ATTRS(ConcatenateAttrs, "relay.attrs.ConcatenateAttrs")
Definition: transform.h:78
Definition: transform.h:149
Attributes for Clip operator.
Definition: transform.h:358
Definition: transform.h:132
int num_newaxis
Definition: transform.h:48
TVM_DECLARE_ATTRS(TileAttrs, "relay.attrs.TileAttrs")
Definition: transform.h:256
Attributes for StridedSlice operator.
Definition: transform.h:320
Optional< Array< Integer > > begin
Definition: transform.h:321
TVM_DECLARE_ATTRS(ClipAttrs, "relay.attrs.ClipAttrs")
Definition: transform.h:362
TVM_DECLARE_ATTRS(UniqueAttrs, "relay.attrs.UniqueAttrs")
Definition: transform.h:496
Helpers for attribute objects.
ObjectRef indices_or_sections
Definition: transform.h:304
Integer batch_dims
Definition: transform.h:160
Definition: transform.h:346
Optional< Array< Integer > > shape
Definition: transform.h:195
Attributes used in MXNet-style reshape_like operators.
Definition: transform.h:105
Attributes used in dynamic expand_dims operators.
Definition: transform.h:64
TVM_DECLARE_ATTRS(SequenceMaskAttrs, "relay.attrs.SequenceMaskAttrs")
Definition: transform.h:419
Expr start
Definition: transform.h:206
TVM_DECLARE_ATTRS(EinsumAttrs, "relay.attrs.EinsumAttrs")
Definition: transform.h:508
Attributes used in einsum operator.
Definition: transform.h:505
String equation
Definition: transform.h:506
Attributes used in cumsum and cumprod operator.
Definition: transform.h:477
TVM_DECLARE_ATTRS(SparseToDenseAttrs, "relay.attrs.SparseToDenseAttrs")
Definition: transform.h:430
Integer batch_dims
Definition: transform.h:174
Runtime primitive data type.
Definition: data_type.h:41
Attributes for LayoutTransform operator.
Definition: transform.h:382
Attributes used in arange operators.
Definition: transform.h:205
TVM_DECLARE_ATTRS(GatherNDAttrs, "relay.attrs.GatherNDAttrs")
Definition: transform.h:163
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:270
Attributes used in reverse operators.
Definition: transform.h:264
TVM_DECLARE_ATTRS(ScatterAttrs, "relay.attrs.ScatterAttrs")
Definition: transform.h:127
Definition: transform.h:303
TVM_DECLARE_ATTRS(ReverseAttrs, "relay.attrs.ReverseAttrs")
Definition: transform.h:266
double a_min
Definition: transform.h:359
int depth
Definition: transform.h:446
Attributes used in meshgrid operators.
Definition: transform.h:220
DataType dtype
Definition: transform.h:479
TVM_DECLARE_ATTRS(GatherAttrs, "relay.attrs.GatherAttrs")
Definition: transform.h:152
#define TVM_ATTR_FIELD(FieldName)
Declare an attribute field.
Definition: attrs.h:76
TVM_DECLARE_ATTRS(ArangeAttrs, "relay.attrs.ArangeAttrs")
Definition: transform.h:211
Attributes used in tile operators.
Definition: transform.h:254
DataType dtype
Definition: transform.h:209
bool sorted
Definition: transform.h:494
Reference to string objects.
Definition: string.h:129
String mode
Definition: transform.h:141
TVM_DECLARE_ATTRS(InitOpAttrs, "relay.attrs.InitOpAttrs")
Definition: transform.h:198
TVM_DECLARE_ATTRS(ScatterAddAttrs, "relay.attrs.ScatterAddAttrs")
Definition: transform.h:135
Managed reference to RelayExprNode.
Definition: expr.h:177
Expr stop
Definition: transform.h:207
Integer lhs_end
Definition: transform.h:107
TVM_DECLARE_ATTRS(AutoSchedulerLayoutTransformAttrs, "relay.attrs.AutoSchedulerLayoutTransformAttrs")
Definition: transform.h:398
TVM_DECLARE_ATTRS(SqueezeAttrs, "relay.attrs.SqueezeAttrs")
Definition: transform.h:292
TVM_DECLARE_ATTRS(SliceLikeAttrs, "relay.attrs.SliceLikeAttrs")
Definition: transform.h:349
Integer axis
Definition: transform.h:478
std::string slice_mode
Definition: transform.h:324
Array< Integer > reps
Definition: transform.h:255
Integer seq_axis
Definition: transform.h:275
TVM_DECLARE_ATTRS(ScatterNDAttrs, "relay.attrs.ScatterNDAttrs")
Definition: transform.h:143
bool super_diag_right_align
Definition: transform.h:461
bool return_counts
Definition: transform.h:495
Base class of all object reference.
Definition: object.h:504
DataType NullValue< DataType >()
Definition: attrs.h:90
Integer axis
Definition: transform.h:125
TVM_DECLARE_ATTRS(CastAttrs, "relay.attrs.CastAttrs")
Definition: transform.h:40
Attributes used in sparse_to_dense operator.
Definition: transform.h:427
std::string indexing
Definition: transform.h:221
int num_newaxis
Definition: transform.h:65
std::string src_layout
Definition: transform.h:395
TVM_DECLARE_ATTRS(TransposeAttrs, "relay.attrs.TransposeAttrs")
Definition: transform.h:90
TVM_DECLARE_ATTRS(SplitAttrs, "relay.attrs.SplitAttrs")
Definition: transform.h:307
Attributes for ndarray_size operator.
Definition: transform.h:436
Optional< Array< Integer > > axes
Definition: transform.h:325
Definition: transform.h:140
TVM_DECLARE_ATTRS(MeshgridAttrs, "relay.attrs.MeshgridAttrs")
Definition: transform.h:223
Attributes used in stack operators.
Definition: transform.h:233
int32_t shift
Definition: transform.h:371
Definition: transform.h:173
double mask_value
Definition: transform.h:416
DataType dtype
Definition: transform.h:437
The base class of the all the Use "curiously recurring template pattern".
Definition: attrs.h:793
DataType dtype
Definition: transform.h:408
bool sub_diag_right_align
Definition: transform.h:462
TVM_DECLARE_ATTRS(ReverseSequenceAttrs, "relay.attrs.ReverseSequenceAttrs")
Definition: transform.h:278
int k1
Definition: transform.h:459
Expr step
Definition: transform.h:208
Attributes used in repeat operators.
Definition: transform.h:242
Optional< Array< Integer > > strides
Definition: transform.h:323
Attributes used in squeeze operators.
Definition: transform.h:288
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:384
Array< Integer > axis
Definition: transform.h:290
TVM_DECLARE_ATTRS(RepeatAttrs, "relay.attrs.RepeatAttrs")
Definition: transform.h:245
int axis
Definition: transform.h:77
Attributes for AutoSchedulerLayoutTransform operator.
Definition: transform.h:393
TObjectRef NullValue()
Create a NodeRef type that represents null.
Definition: attrs.h:84
TVM_DECLARE_ATTRS(TakeAttrs, "relay.attrs.TakeAttrs")
Definition: transform.h:178
Definition: transform.h:415
Integer rhs_end
Definition: transform.h:109
Attributes used in reverse_sequence operators.
Definition: transform.h:274
Attributes used in reshape operators.
Definition: transform.h:96
Optional< Integer > index_rank
Definition: transform.h:161
TVM_DECLARE_ATTRS(OneHotAttrs, "relay.attrs.OneHotAttrs")
Definition: transform.h:450
Integer axis
Definition: transform.h:133
Attributes for ShapeOf operator.
Definition: transform.h:407
Integer axis
Definition: transform.h:150
TVM_DECLARE_ATTRS(ScanopAttrs, "relay.attrs.ScanopAttrs")
Definition: transform.h:481
Array< Integer > output_shape
Definition: transform.h:428
Optional< Array< Integer > > end
Definition: transform.h:322
Integer axis
Definition: transform.h:244
Integer axis
Definition: transform.h:234
TVM_DECLARE_ATTRS(FixedPointMultiplyAttrs, "relay.attrs.FixedPointMultiplyAttrs")
Definition: transform.h:373
int k2
Definition: transform.h:460
Attributes used in concatenate operators.
Definition: transform.h:76
Integer batch_axis
Definition: transform.h:276
Container of constant int that adds more constructors.
Definition: expr.h:356
Integer axis
Definition: transform.h:175