25 #ifndef NNVM_TOP_TENSOR_H_ 26 #define NNVM_TOP_TENSOR_H_ 38 DMLC_DECLARE_FIELD(axis).set_default(1)
39 .describe(
"the axis to be concated.");
47 DMLC_DECLARE_FIELD(axis)
48 .describe(
"the axis to be expanded.");
49 DMLC_DECLARE_FIELD(num_newaxis).set_lower_bound(1).set_default(1)
50 .describe(
"Number of new axis to be inserted.");
63 DMLC_DECLARE_FIELD(indices_or_sections)
64 .describe(
"Number of outputs to be splitted");
65 DMLC_DECLARE_FIELD(axis).set_default(1)
66 .describe(
"the axis to be splitted.");
71 struct TakeParam :
public dmlc::Parameter<TakeParam> {
76 .describe(
"the axis over which to select values.");
87 DMLC_DECLARE_FIELD(begin)
88 .describe(
"Indices for begin of slice");
89 DMLC_DECLARE_FIELD(end)
90 .describe(
"Indices for end of the slice");
92 .describe(
"Stride values of the slice");
117 #define DMLC_DECLARE_DTYPE_FIELD(name) \ 118 DMLC_DECLARE_FIELD(name) \ 119 .add_enum("float16", kFloat16) \ 120 .add_enum("float32", kFloat32) \ 121 .add_enum("float64", kFloat64) \ 122 .add_enum("uint8", kUint8) \ 123 .add_enum("uint16", kUint16) \ 124 .add_enum("uint32", kUint32) \ 125 .add_enum("uint64", kUint64) \ 126 .add_enum("int8", kInt8) \ 127 .add_enum("int16", kInt16) \ 128 .add_enum("int32", kInt32) \ 129 .add_enum("int64", kInt64) 135 .describe(
"Output data type.");
143 DMLC_DECLARE_FIELD(axis).set_default(
TShape())
144 .describe(R
"code(The axis or axes along which to perform the indicator rule. 146 The default, `axis=()`, will compute over all elements into a 147 scalar array with shape `(1,)`. 149 If `axis` is int, rule is applied on a particular axis. 151 If `axis` is a tuple of ints, rule is applied on all the axes 152 specified in the tuple. 154 If `exclude` is true, rule will be applied on the axes that are 155 NOT in axis instead.)code"); 156 DMLC_DECLARE_FIELD(exclude).set_default(false)
157 .describe(
"Whether to apply rule on axis that are NOT in axis instead.");
165 DMLC_DECLARE_FIELD(shape);
173 DMLC_DECLARE_FIELD(axis).set_default(
TShape())
174 .describe(
"The axis to squeeze in the input tensor.");
182 DMLC_DECLARE_FIELD(scalar);
190 DMLC_DECLARE_FIELD(fill_value)
191 .describe(
"Scalar value to be filled");
199 DMLC_DECLARE_FIELD(axes).set_default(
TShape())
200 .describe(
"Target axis order. By default the axes will be inverted.");
207 DMLC_DECLARE_FIELD(axis).set_default(0)
208 .describe(
"the axis to be reveresed.");
216 DMLC_DECLARE_FIELD(shape).set_default(
TShape())
217 .describe(
"The shape of the desired array." 218 " We can set the dim to zero if it's same as the original." 219 " E.g `A = broadcast_to(B, shape=(10, 0, 0))` ");
230 DMLC_DECLARE_FIELD(axis).set_default(
TShape())
231 .describe(R
"code(The axis or axes along which to perform the reduction. 233 The default, `axis=()`, will compute over all elements into a 234 scalar array with shape `(1,)`. 236 If `axis` is int, a reduction is performed on a particular axis. 238 If `axis` is a tuple of ints, a reduction is performed on all the axes 239 specified in the tuple. 241 If `exclude` is true, reduction will be performed on the axes that are 242 NOT in axis instead.)code"); 244 DMLC_DECLARE_FIELD(keepdims).set_default(false)
245 .describe(
"If this is set to `True`, the reduced axes are left " 246 "in the result as dimension with size one.");
247 DMLC_DECLARE_FIELD(exclude).set_default(
false)
248 .describe(
"Whether to perform reduction on axis that are NOT in axis instead.");
250 .describe(
"Target data type.");
260 DMLC_DECLARE_FIELD(shape).set_default(
TShape());
262 .describe(
"Target data type.");
263 DMLC_DECLARE_FIELD(fill_value).describe(
"Scalar value to fill");
272 DMLC_DECLARE_FIELD(shape).set_default(
TShape());
274 .describe(
"Target data type.");
281 DMLC_DECLARE_FIELD(num_args).set_lower_bound(1)
282 .describe(
"Number of inputs to be reduced.");
291 DMLC_DECLARE_FIELD(transpose_a)
292 .describe(
"If true then transpose the first input before dot.")
294 DMLC_DECLARE_FIELD(transpose_b)
295 .describe(
"If true then transpose the second input before dot.")
303 DMLC_DECLARE_FIELD(a_min)
304 .describe(
"Minimum value such that value smaller then this will be clipped.");
305 DMLC_DECLARE_FIELD(a_max)
306 .describe(
"Maximum value such that value larger then this will be clipped.");
313 DMLC_DECLARE_FIELD(axis).set_default(
Tuple<int>())
314 .describe(
"List of axes on which input data will be sliced according to the " 315 "corresponding size of the second input. By default will slice " 316 "on all axes. Negative axes are supported.");
323 #endif // NNVM_TOP_TENSOR_H_ int axis
Definition: tensor.h:57
int axis
Definition: tensor.h:44
int dtype
Definition: tensor.h:227
dmlc::optional< int > axis
Definition: tensor.h:72
DMLC_DECLARE_PARAMETER(SqueezeParam)
Definition: tensor.h:172
int dtype
Definition: tensor.h:132
Tuple< int64_t > begin
Definition: tensor.h:82
DMLC_DECLARE_PARAMETER(MatMulParam)
Definition: tensor.h:290
double scalar
Definition: tensor.h:179
DMLC_DECLARE_PARAMETER(CastParam)
Definition: tensor.h:133
bool exclude
Definition: tensor.h:141
DMLC_DECLARE_PARAMETER(ElementWiseReduceParam)
Definition: tensor.h:280
int num_args
Definition: tensor.h:279
bool keepdims
Definition: tensor.h:225
DMLC_DECLARE_PARAMETER(SplitParam)
Definition: tensor.h:62
DMLC_DECLARE_PARAMETER(IndicatorParam)
Definition: tensor.h:142
DMLC_DECLARE_PARAMETER(InitOpWithScalarParam)
Definition: tensor.h:259
TShape axis
Definition: tensor.h:170
TShape shape
Definition: tensor.h:268
Tuple< int64_t > end
Definition: tensor.h:83
DMLC_DECLARE_PARAMETER(FillValueParam)
Definition: tensor.h:189
DMLC_DECLARE_PARAMETER(TransposeParam)
Definition: tensor.h:198
int dtype
Definition: tensor.h:256
A Shape class that is used to represent shape of each tensor.
Definition: tuple.h:344
int axis
Definition: tensor.h:205
DMLC_DECLARE_PARAMETER(ExpandDimsParam)
Definition: tensor.h:46
DMLC_DECLARE_PARAMETER(ScalarParam)
Definition: tensor.h:181
double fill_value
Definition: tensor.h:187
DMLC_DECLARE_PARAMETER(FlipParam)
Definition: tensor.h:206
DMLC_DECLARE_PARAMETER(ClipParam)
Definition: tensor.h:302
bool transpose_a
Definition: tensor.h:287
DMLC_DECLARE_PARAMETER(InitOpParam)
Definition: tensor.h:271
TShape axis
Definition: tensor.h:224
TypeFlag
Definition: tensor.h:96
IndicatorRuleFlag
Definition: tensor.h:110
#define DMLC_DECLARE_DTYPE_FIELD(name)
Definition: tensor.h:117
double a_min
Definition: tensor.h:301
bool equal_split
Definition: tensor.h:60
Tuple< int64_t > stride
Definition: tensor.h:84
TShape shape
Definition: tensor.h:213
Data structure Tuple and TShape to store dynamic sized shapes.
TShape axis
Definition: tensor.h:140
DMLC_DECLARE_PARAMETER(ReduceParam)
Definition: tensor.h:229
Tuple< int64_t > shape
Definition: tensor.h:162
bool exclude
Definition: tensor.h:226
Tuple< int > indices_or_sections
Definition: tensor.h:56
int dtype
Definition: tensor.h:269
int num_newaxis
Definition: tensor.h:45
TShape shape
Definition: tensor.h:255
DMLC_DECLARE_PARAMETER(StridedSliceParam)
Definition: tensor.h:86
DMLC_DECLARE_PARAMETER(ConcatenateParam)
Definition: tensor.h:37
DMLC_DECLARE_PARAMETER(ReshapeParam)
Definition: tensor.h:164
bool transpose_b
Definition: tensor.h:288
double fill_value
Definition: tensor.h:257
DMLC_DECLARE_PARAMETER(BroadcastToParam)
Definition: tensor.h:215
TShape axes
Definition: tensor.h:196
DMLC_DECLARE_PARAMETER(SliceLikeParam)
Definition: tensor.h:312
Tuple< int > axis
Definition: tensor.h:311
Provide lightweight util to do parameter setup and checking.
int axis
Definition: tensor.h:36
DMLC_DECLARE_PARAMETER(TakeParam)
Definition: tensor.h:74