8 #ifndef MXNET_CPP_OP_H_ 9 #define MXNET_CPP_OP_H_ 17 #include "dmlc/optional.h" 18 #include "nnvm/tuple.h" 64 const std::vector<Symbol>& args) {
67 .CreateSymbol(symbol_name);
82 bool init_output =
true) {
84 .
SetParam(
"init_output", init_output)
101 const std::vector<Symbol>& data,
103 bool init_output =
true) {
106 .
SetParam(
"init_output", init_output)
108 .CreateSymbol(symbol_name);
127 const std::vector<Symbol>& data,
128 const std::string& op_type) {
131 .CreateSymbol(symbol_name);
192 return Operator(
"broadcast_maximum")
225 return Operator(
"broadcast_minimum")
349 bool keep_highest =
false) {
353 .
SetParam(
"target_shape", target_shape)
354 .
SetParam(
"keep_highest", keep_highest)
572 dmlc::optional<int> end) {
735 dmlc::optional<int> axis = dmlc::optional<int>()) {
853 const std::vector<Symbol>& data,
860 .CreateSymbol(symbol_name);
886 const std::vector<Symbol>& data,
887 dmlc::optional<Shape> axis = dmlc::optional<Shape>()) {
891 .CreateSymbol(symbol_name);
1073 const std::vector<Symbol>& args) {
1076 .CreateSymbol(symbol_name);
1112 dmlc::optional<int> axis = dmlc::optional<int>(),
1113 bool keepdims =
false) {
1154 dmlc::optional<int> axis = dmlc::optional<int>(),
1155 bool keepdims =
false) {
1260 dmlc::optional<int> axis = dmlc::optional<int>(-1),
1261 bool keepdims =
false,
1263 static const char *PickModeValues[] = {
1270 .
SetParam(
"mode", PickModeValues[
int(mode)])
1348 bool transpose_a =
false,
1349 bool transpose_b =
false,
1351 static const char *DotForwardStypeValues[] = {
1358 .
SetParam(
"transpose_a", transpose_a)
1359 .
SetParam(
"transpose_b", transpose_b)
1360 .
SetParam(
"forward_stype", DotForwardStypeValues[
int(forward_stype)])
1405 bool transpose_a =
false,
1406 bool transpose_b =
false,
1408 static const char *Batch_dotForwardStypeValues[] = {
1415 .
SetParam(
"transpose_a", transpose_a)
1416 .
SetParam(
"transpose_b", transpose_b)
1417 .
SetParam(
"forward_stype", Batch_dotForwardStypeValues[
int(forward_stype)])
1841 dmlc::optional<int> lhs_begin = dmlc::optional<int>(),
1842 dmlc::optional<int> lhs_end = dmlc::optional<int>(),
1843 dmlc::optional<int> rhs_begin = dmlc::optional<int>(),
1844 dmlc::optional<int> rhs_end = dmlc::optional<int>()) {
1909 static const char *CastDtypeValues[] = {
1919 .
SetParam(
"dtype", CastDtypeValues[
int(dtype)])
2599 static const char *Amp_castDtypeValues[] = {
2609 .
SetParam(
"dtype", Amp_castDtypeValues[
int(dtype)])
2628 const std::vector<Symbol>& data,
2631 .
SetParam(
"num_outputs", num_outputs)
2633 .CreateSymbol(symbol_name);
2703 dmlc::optional<int> axis = dmlc::optional<int>(-1),
2706 bool is_ascend =
false,
2708 static const char *TopkRetTypValues[] = {
2714 static const char *TopkDtypeValues[] = {
2724 .
SetParam(
"ret_typ", TopkRetTypValues[
int(ret_typ)])
2726 .
SetParam(
"dtype", TopkDtypeValues[
int(dtype)])
2765 dmlc::optional<int> axis = dmlc::optional<int>(-1),
2766 bool is_ascend =
true) {
2819 dmlc::optional<int> axis = dmlc::optional<int>(-1),
2820 bool is_ascend =
true,
2822 static const char *ArgsortDtypeValues[] = {
2832 .
SetParam(
"dtype", ArgsortDtypeValues[
int(dtype)])
3021 bool sparse_grad =
false) {
3022 static const char *EmbeddingDtypeValues[] = {
3033 .
SetParam(
"output_dim", output_dim)
3034 .
SetParam(
"dtype", EmbeddingDtypeValues[
int(dtype)])
3035 .
SetParam(
"sparse_grad", sparse_grad)
3118 static const char *TakeModeValues[] = {
3125 .
SetParam(
"mode", TakeModeValues[
int(mode)])
3227 double on_value = 1,
3228 double off_value = 0,
3230 static const char *One_hotDtypeValues[] = {
3243 .
SetParam(
"dtype", One_hotDtypeValues[
int(dtype)])
3406 return Operator(
"broadcast_not_equal")
3437 return Operator(
"broadcast_greater")
3468 return Operator(
"broadcast_greater_equal")
3499 return Operator(
"broadcast_lesser")
3530 return Operator(
"broadcast_lesser_equal")
3561 return Operator(
"broadcast_logical_and")
3592 return Operator(
"broadcast_logical_or")
3623 return Operator(
"broadcast_logical_xor")
3843 static const char *Cast_storageStypeValues[] = {
3849 .
SetParam(
"stype", Cast_storageStypeValues[
int(stype)])
3914 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
3915 bool keepdims =
false,
3916 bool exclude =
false) {
3951 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
3952 bool keepdims =
false,
3953 bool exclude =
false) {
3988 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
3989 bool keepdims =
false,
3990 bool exclude =
false) {
4027 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
4028 bool keepdims =
false,
4029 bool exclude =
false) {
4066 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
4067 bool keepdims =
false,
4068 bool exclude =
false) {
4103 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
4104 bool keepdims =
false,
4105 bool exclude =
false) {
4140 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
4141 bool keepdims =
false,
4142 bool exclude =
false) {
4259 dmlc::optional<Shape> lhs_axes = dmlc::optional<Shape>(),
4260 dmlc::optional<Shape> rhs_axes = dmlc::optional<Shape>()) {
4328 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
4330 bool keepdims =
false) {
4331 static const char *NormOutDtypeValues[] = {
4343 .
SetParam(
"out_dtype", NormOutDtypeValues[
int(out_dtype)])
4809 bool global_pool =
false,
4810 bool cudnn_off =
false,
4814 dmlc::optional<int> p_value = dmlc::optional<int>(),
4815 dmlc::optional<bool> count_include_pad = dmlc::optional<bool>(),
4817 static const char *PoolingPoolTypeValues[] = {
4823 static const char *PoolingPoolingConventionValues[] = {
4828 static const char *PoolingLayoutValues[] = {
4839 .
SetParam(
"pool_type", PoolingPoolTypeValues[
int(pool_type)])
4840 .
SetParam(
"global_pool", global_pool)
4842 .
SetParam(
"pooling_convention", PoolingPoolingConventionValues[
int(pooling_convention)])
4846 .
SetParam(
"count_include_pad", count_include_pad)
4847 .
SetParam(
"layout", PoolingLayoutValues[
int(layout)])
4897 dmlc::optional<double> temperature = dmlc::optional<double>(),
4899 static const char *SoftmaxDtypeValues[] = {
4907 .
SetParam(
"temperature", temperature)
4908 .
SetParam(
"dtype", SoftmaxDtypeValues[
int(dtype)])
4959 dmlc::optional<double> temperature = dmlc::optional<double>(),
4961 static const char *SoftminDtypeValues[] = {
4969 .
SetParam(
"temperature", temperature)
4970 .
SetParam(
"dtype", SoftminDtypeValues[
int(dtype)])
5011 dmlc::optional<double> temperature = dmlc::optional<double>(),
5013 static const char *Log_softmaxDtypeValues[] = {
5021 .
SetParam(
"temperature", temperature)
5022 .
SetParam(
"dtype", Log_softmaxDtypeValues[
int(dtype)])
5081 uint32_t num_filter,
5087 uint32_t num_group = 1,
5088 uint64_t workspace = 512,
5089 bool no_bias =
true,
5091 bool cudnn_off =
false,
5093 static const char *DeconvolutionCudnnTuneValues[] = {
5096 "limited_workspace",
5099 static const char *DeconvolutionLayoutValues[] = {
5109 .
SetParam(
"num_filter", num_filter)
5114 .
SetParam(
"target_shape", target_shape)
5118 .
SetParam(
"cudnn_tune", DeconvolutionCudnnTuneValues[
int(cudnn_tune)])
5120 .
SetParam(
"layout", DeconvolutionLayoutValues[
int(layout)])
5159 static const char *ActivationActTypeValues[] = {
5167 .
SetParam(
"act_type", ActivationActTypeValues[
int(act_type)])
5246 double eps = 0.0010000000474974513,
5248 bool fix_gamma =
true,
5249 bool use_global_stats =
false,
5250 bool output_mean_var =
false,
5252 bool cudnn_off =
false) {
5257 .
SetParam(
"use_global_stats", use_global_stats)
5258 .
SetParam(
"output_mean_var", output_mean_var)
5264 .
SetInput(
"moving_mean", moving_mean)
5265 .
SetInput(
"moving_var", moving_var)
5351 bool use_data_lengths =
false,
5352 bool use_label_lengths =
false,
5354 static const char *CTCLossBlankLabelValues[] = {
5359 .
SetParam(
"use_data_lengths", use_data_lengths)
5360 .
SetParam(
"use_label_lengths", use_label_lengths)
5361 .
SetParam(
"blank_label", CTCLossBlankLabelValues[
int(blank_label)])
5364 .
SetInput(
"data_lengths", data_lengths)
5365 .
SetInput(
"label_lengths", label_lengths)
5417 bool no_bias =
false,
5418 bool flatten =
true) {
5420 .
SetParam(
"num_hidden", num_hidden)
5552 uint32_t num_filter,
5556 uint32_t num_group = 1,
5557 uint64_t workspace = 1024,
5558 bool no_bias =
false,
5560 bool cudnn_off =
false,
5562 static const char *ConvolutionCudnnTuneValues[] = {
5565 "limited_workspace",
5568 static const char *ConvolutionLayoutValues[] = {
5578 .
SetParam(
"num_filter", num_filter)
5585 .
SetParam(
"cudnn_tune", ConvolutionCudnnTuneValues[
int(cudnn_tune)])
5587 .
SetParam(
"layout", ConvolutionLayoutValues[
int(layout)])
5676 const std::vector<Symbol>& data,
5682 uint64_t workspace = 512) {
5683 static const char *UpSamplingSampleTypeValues[] = {
5687 static const char *UpSamplingMultiInputModeValues[] = {
5693 .
SetParam(
"sample_type", UpSamplingSampleTypeValues[
int(sample_type)])
5695 .
SetParam(
"num_filter", num_filter)
5696 .
SetParam(
"multi_input_mode", UpSamplingMultiInputModeValues[
int(multi_input_mode)])
5699 .CreateSymbol(symbol_name);
5749 const std::vector<Symbol>& data,
5756 .CreateSymbol(symbol_name);
5803 bool output_mean_var =
false) {
5807 .
SetParam(
"output_mean_var", output_mean_var)
5909 dmlc::optional<bool> cudnn_off = dmlc::optional<bool>(0)) {
5910 static const char *DropoutModeValues[] = {
5916 .
SetParam(
"mode", DropoutModeValues[
int(mode)])
5967 static const char *SoftmaxActivationModeValues[] = {
5971 return Operator(
"SoftmaxActivation")
5972 .
SetParam(
"mode", SoftmaxActivationModeValues[
int(mode)])
6008 dmlc::optional<Shape> axes = dmlc::optional<Shape>(),
6009 bool keepdims =
false) {
6064 mx_float upper_bound = 0.333999991) {
6065 static const char *LeakyReLUActTypeValues[] = {
6074 .
SetParam(
"act_type", LeakyReLUActTypeValues[
int(act_type)])
6076 .
SetParam(
"lower_bound", lower_bound)
6077 .
SetParam(
"upper_bound", upper_bound)
6174 uint32_t state_size,
6175 uint32_t num_layers,
6177 bool bidirectional =
false,
6179 bool state_outputs =
false,
6180 dmlc::optional<int> projection_size = dmlc::optional<int>(),
6181 dmlc::optional<double> lstm_state_clip_min = dmlc::optional<double>(),
6182 dmlc::optional<double> lstm_state_clip_max = dmlc::optional<double>(),
6183 bool lstm_state_clip_nan =
false,
6184 bool use_sequence_length =
false) {
6185 static const char *RNNModeValues[] = {
6192 .
SetParam(
"state_size", state_size)
6193 .
SetParam(
"num_layers", num_layers)
6194 .
SetParam(
"mode", RNNModeValues[
int(mode)])
6195 .
SetParam(
"bidirectional", bidirectional)
6197 .
SetParam(
"state_outputs", state_outputs)
6198 .
SetParam(
"projection_size", projection_size)
6199 .
SetParam(
"lstm_state_clip_min", lstm_state_clip_min)
6200 .
SetParam(
"lstm_state_clip_max", lstm_state_clip_max)
6201 .
SetParam(
"lstm_state_clip_nan", lstm_state_clip_nan)
6202 .
SetParam(
"use_sequence_length", use_sequence_length)
6204 .
SetInput(
"parameters", parameters)
6206 .
SetInput(
"state_cell", state_cell)
6207 .
SetInput(
"sequence_length", sequence_length)
6319 bool multi_output =
false,
6320 bool use_ignore =
false,
6321 bool preserve_shape =
false,
6323 bool out_grad =
false,
6325 static const char *SoftmaxOutputNormalizationValues[] = {
6331 .
SetParam(
"grad_scale", grad_scale)
6332 .
SetParam(
"ignore_label", ignore_label)
6333 .
SetParam(
"multi_output", multi_output)
6334 .
SetParam(
"use_ignore", use_ignore)
6335 .
SetParam(
"preserve_shape", preserve_shape)
6336 .
SetParam(
"normalization", SoftmaxOutputNormalizationValues[
int(normalization)])
6338 .
SetParam(
"smooth_alpha", smooth_alpha)
6375 uint32_t dim2 = 0) {
6449 bool fix_gamma =
true,
6450 bool use_global_stats =
false,
6451 bool output_mean_var =
false) {
6456 .
SetParam(
"use_global_stats", use_global_stats)
6457 .
SetParam(
"output_mean_var", output_mean_var)
6504 return Operator(
"softmax_cross_entropy")
6543 return Operator(
"LinearRegressionOutput")
6544 .
SetParam(
"grad_scale", grad_scale)
6584 return Operator(
"MAERegressionOutput")
6585 .
SetParam(
"grad_scale", grad_scale)
6631 return Operator(
"LogisticRegressionOutput")
6632 .
SetParam(
"grad_scale", grad_scale)
6649 mx_float sparseness_target = 0.100000001,
6652 return Operator(
"IdentityAttachKLSparseReg")
6653 .
SetParam(
"sparseness_target", sparseness_target)
6698 .
SetParam(
"rescale_grad", rescale_grad)
6699 .
SetParam(
"clip_gradient", clip_gradient)
6753 .
SetParam(
"rescale_grad", rescale_grad)
6754 .
SetParam(
"clip_gradient", clip_gradient)
6784 const std::vector<Symbol>& data,
6785 nnvm::Tuple<mx_float> lrs,
6786 nnvm::Tuple<mx_float> wds,
6789 int num_weights = 1) {
6790 return Operator(
"multi_sgd_update")
6793 .
SetParam(
"rescale_grad", rescale_grad)
6794 .
SetParam(
"clip_gradient", clip_gradient)
6795 .
SetParam(
"num_weights", num_weights)
6797 .CreateSymbol(symbol_name);
6835 const std::vector<Symbol>& data,
6836 nnvm::Tuple<mx_float> lrs,
6837 nnvm::Tuple<mx_float> wds,
6841 int num_weights = 1) {
6842 return Operator(
"multi_sgd_mom_update")
6846 .
SetParam(
"rescale_grad", rescale_grad)
6847 .
SetParam(
"clip_gradient", clip_gradient)
6848 .
SetParam(
"num_weights", num_weights)
6850 .CreateSymbol(symbol_name);
6875 const std::vector<Symbol>& data,
6876 nnvm::Tuple<mx_float> lrs,
6877 nnvm::Tuple<mx_float> wds,
6880 int num_weights = 1) {
6881 return Operator(
"multi_mp_sgd_update")
6884 .
SetParam(
"rescale_grad", rescale_grad)
6885 .
SetParam(
"clip_gradient", clip_gradient)
6886 .
SetParam(
"num_weights", num_weights)
6888 .CreateSymbol(symbol_name);
6926 const std::vector<Symbol>& data,
6927 nnvm::Tuple<mx_float> lrs,
6928 nnvm::Tuple<mx_float> wds,
6932 int num_weights = 1) {
6933 return Operator(
"multi_mp_sgd_mom_update")
6937 .
SetParam(
"rescale_grad", rescale_grad)
6938 .
SetParam(
"clip_gradient", clip_gradient)
6939 .
SetParam(
"num_weights", num_weights)
6941 .CreateSymbol(symbol_name);
6979 bool lazy_update =
true) {
6983 .
SetParam(
"rescale_grad", rescale_grad)
6984 .
SetParam(
"clip_gradient", clip_gradient)
6985 .
SetParam(
"lazy_update", lazy_update)
7044 bool lazy_update =
true) {
7049 .
SetParam(
"rescale_grad", rescale_grad)
7050 .
SetParam(
"clip_gradient", clip_gradient)
7051 .
SetParam(
"lazy_update", lazy_update)
7081 bool lazy_update =
true) {
7085 .
SetParam(
"rescale_grad", rescale_grad)
7086 .
SetParam(
"clip_gradient", clip_gradient)
7087 .
SetParam(
"lazy_update", lazy_update)
7121 bool lazy_update =
true) {
7122 return Operator(
"mp_sgd_mom_update")
7126 .
SetParam(
"rescale_grad", rescale_grad)
7127 .
SetParam(
"clip_gradient", clip_gradient)
7128 .
SetParam(
"lazy_update", lazy_update)
7181 double epsilon = 9.9999999392252903e-09,
7192 .
SetParam(
"rescale_grad", rescale_grad)
7263 bool lazy_update =
true) {
7270 .
SetParam(
"rescale_grad", rescale_grad)
7271 .
SetParam(
"clip_gradient", clip_gradient)
7272 .
SetParam(
"lazy_update", lazy_update)
7323 .
SetParam(
"rescale_grad", rescale_grad)
7324 .
SetParam(
"clip_gradient", clip_gradient)
7360 return Operator(
"mp_nag_mom_update")
7364 .
SetParam(
"rescale_grad", rescale_grad)
7365 .
SetParam(
"clip_gradient", clip_gradient)
7442 .
SetParam(
"rescale_grad", rescale_grad)
7443 .
SetParam(
"clip_gradient", clip_gradient)
7444 .
SetParam(
"clip_weights", clip_weights)
7510 return Operator(
"rmspropalex_update")
7516 .
SetParam(
"rescale_grad", rescale_grad)
7517 .
SetParam(
"clip_gradient", clip_gradient)
7518 .
SetParam(
"clip_weights", clip_weights)
7582 .
SetParam(
"rescale_grad", rescale_grad)
7583 .
SetParam(
"clip_gradient", clip_gradient)
7666 bool squeeze_axis =
false) {
7668 .
SetParam(
"num_outputs", num_outputs)
7670 .
SetParam(
"squeeze_axis", squeeze_axis)
7784 double constant_value = 0) {
7785 static const char *PadModeValues[] = {
7791 .
SetParam(
"mode", PadModeValues[
int(mode)])
7793 .
SetParam(
"constant_value", constant_value)
7883 static const char *GridGeneratorTransformTypeValues[] = {
7888 .
SetParam(
"transform_type", GridGeneratorTransformTypeValues[
int(transform_type)])
7889 .
SetParam(
"target_shape", target_shape)
7964 bool global_pool =
false,
7968 static const char *Pooling_v1PoolTypeValues[] = {
7973 static const char *Pooling_v1PoolingConventionValues[] = {
7979 .
SetParam(
"pool_type", Pooling_v1PoolTypeValues[
int(pool_type)])
7980 .
SetParam(
"global_pool", global_pool)
7981 .
SetParam(
"pooling_convention", Pooling_v1PoolingConventionValues[
int(pooling_convention)])
8050 uint32_t num_filter,
8054 uint32_t num_group = 1,
8055 uint64_t workspace = 1024,
8056 bool no_bias =
false,
8058 bool cudnn_off =
false,
8060 static const char *Convolution_v1CudnnTuneValues[] = {
8063 "limited_workspace",
8066 static const char *Convolution_v1LayoutValues[] = {
8075 .
SetParam(
"num_filter", num_filter)
8082 .
SetParam(
"cudnn_tune", Convolution_v1CudnnTuneValues[
int(cudnn_tune)])
8084 .
SetParam(
"layout", Convolution_v1LayoutValues[
int(layout)])
8112 const std::vector<Symbol>& data,
8116 bool center_crop =
false) {
8121 .
SetParam(
"center_crop", center_crop)
8123 .CreateSymbol(symbol_name);
8205 bool use_sequence_length =
false,
8208 .
SetParam(
"use_sequence_length", use_sequence_length)
8211 .
SetInput(
"sequence_length", sequence_length)
8244 dmlc::optional<bool> cudnn_off = dmlc::optional<bool>()) {
8245 static const char *SpatialTransformerTransformTypeValues[] = {
8248 static const char *SpatialTransformerSamplerTypeValues[] = {
8251 return Operator(
"SpatialTransformer")
8252 .
SetParam(
"transform_type", SpatialTransformerTransformTypeValues[
int(transform_type)])
8253 .
SetParam(
"sampler_type", SpatialTransformerSamplerTypeValues[
int(sampler_type)])
8254 .
SetParam(
"target_shape", target_shape)
8345 dmlc::optional<bool> cudnn_off = dmlc::optional<bool>()) {
8415 .
SetParam(
"pooled_size", pooled_size)
8416 .
SetParam(
"spatial_scale", spatial_scale)
8480 bool use_sequence_length =
false,
8483 .
SetParam(
"use_sequence_length", use_sequence_length)
8486 .
SetInput(
"sequence_length", sequence_length)
8564 static const char *L2NormalizationModeValues[] = {
8571 .
SetParam(
"mode", L2NormalizationModeValues[
int(mode)])
8625 static const char *MakeLossNormalizationValues[] = {
8631 .
SetParam(
"grad_scale", grad_scale)
8632 .
SetParam(
"valid_thresh", valid_thresh)
8633 .
SetParam(
"normalization", MakeLossNormalizationValues[
int(normalization)])
8657 mx_float regularization_coefficient = 1,
8658 bool use_linear =
false) {
8661 .
SetParam(
"regularization_coefficient", regularization_coefficient)
8662 .
SetParam(
"use_linear", use_linear)
8720 uint32_t kernel_size = 1,
8721 uint32_t max_displacement = 1,
8722 uint32_t stride1 = 1,
8723 uint32_t stride2 = 1,
8724 uint32_t pad_size = 0,
8725 bool is_multiply =
true) {
8727 .
SetParam(
"kernel_size", kernel_size)
8728 .
SetParam(
"max_displacement", max_displacement)
8732 .
SetParam(
"is_multiply", is_multiply)
8819 bool use_sequence_length =
false,
8823 .
SetParam(
"use_sequence_length", use_sequence_length)
8827 .
SetInput(
"sequence_length", sequence_length)
8844 return Operator(
"fill_element_0index")
8906 bool init_output =
true) {
8908 .
SetParam(
"init_output", init_output)
8925 bool init_output =
true) {
8926 return Operator(
"multi_all_finite")
8927 .
SetParam(
"num_arrays", num_arrays)
8928 .
SetParam(
"init_output", init_output)
8948 const std::string& op_type) {
9008 return Operator(
"broadcast_maximum")
9039 return Operator(
"broadcast_minimum")
9159 bool keep_highest =
false) {
9163 .
SetParam(
"target_shape", target_shape)
9164 .
SetParam(
"keep_highest", keep_highest)
9372 dmlc::optional<int> end) {
9447 .
SetInput(
"shape_like", shape_like)
9529 dmlc::optional<int> axis = dmlc::optional<int>()) {
9673 dmlc::optional<Shape> axis = dmlc::optional<Shape>()) {
9723 .
SetParam(
"block_size", block_size)
9773 .
SetParam(
"block_size", block_size)
9886 dmlc::optional<int> axis = dmlc::optional<int>(),
9887 bool keepdims =
false) {
9926 dmlc::optional<int> axis = dmlc::optional<int>(),
9927 bool keepdims =
false) {
10019 dmlc::optional<int> axis = dmlc::optional<int>(-1),
10020 bool keepdims =
false,
10022 static const char *PickModeValues[] = {
10029 .
SetParam(
"mode", PickModeValues[
int(mode)])
10094 bool transpose_a =
false,
10095 bool transpose_b =
false,
10097 static const char *DotForwardStypeValues[] = {
10104 .
SetParam(
"transpose_a", transpose_a)
10105 .
SetParam(
"transpose_b", transpose_b)
10106 .
SetParam(
"forward_stype", DotForwardStypeValues[
int(forward_stype)])
10138 bool transpose_a =
false,
10139 bool transpose_b =
false,
10141 static const char *Batch_dotForwardStypeValues[] = {
10148 .
SetParam(
"transpose_a", transpose_a)
10149 .
SetParam(
"transpose_b", transpose_b)
10150 .
SetParam(
"forward_stype", Batch_dotForwardStypeValues[
int(forward_stype)])
10548 dmlc::optional<int> lhs_begin = dmlc::optional<int>(),
10549 dmlc::optional<int> lhs_end = dmlc::optional<int>(),
10550 dmlc::optional<int> rhs_begin = dmlc::optional<int>(),
10551 dmlc::optional<int> rhs_end = dmlc::optional<int>()) {
10600 static const char *CastDtypeValues[] = {
10610 .
SetParam(
"dtype", CastDtypeValues[
int(dtype)])
11224 static const char *Amp_castDtypeValues[] = {
11234 .
SetParam(
"dtype", Amp_castDtypeValues[
int(dtype)])
11254 .
SetParam(
"num_outputs", num_outputs)
11302 dmlc::optional<int> axis = dmlc::optional<int>(-1),
11305 bool is_ascend =
false,
11307 static const char *TopkRetTypValues[] = {
11313 static const char *TopkDtypeValues[] = {
11323 .
SetParam(
"ret_typ", TopkRetTypValues[
int(ret_typ)])
11325 .
SetParam(
"dtype", TopkDtypeValues[
int(dtype)])
11362 dmlc::optional<int> axis = dmlc::optional<int>(-1),
11363 bool is_ascend =
true) {
11403 dmlc::optional<int> axis = dmlc::optional<int>(-1),
11404 bool is_ascend =
true,
11406 static const char *ArgsortDtypeValues[] = {
11416 .
SetParam(
"dtype", ArgsortDtypeValues[
int(dtype)])
11583 bool sparse_grad =
false) {
11584 static const char *EmbeddingDtypeValues[] = {
11595 .
SetParam(
"output_dim", output_dim)
11596 .
SetParam(
"dtype", EmbeddingDtypeValues[
int(dtype)])
11597 .
SetParam(
"sparse_grad", sparse_grad)
11668 static const char *TakeModeValues[] = {
11675 .
SetParam(
"mode", TakeModeValues[
int(mode)])
11761 double on_value = 1,
11762 double off_value = 0,
11764 static const char *One_hotDtypeValues[] = {
11777 .
SetParam(
"dtype", One_hotDtypeValues[
int(dtype)])
11903 return Operator(
"broadcast_equal")
11932 return Operator(
"broadcast_not_equal")
11961 return Operator(
"broadcast_greater")
11990 return Operator(
"broadcast_greater_equal")
12019 return Operator(
"broadcast_lesser")
12048 return Operator(
"broadcast_lesser_equal")
12077 return Operator(
"broadcast_logical_and")
12106 return Operator(
"broadcast_logical_or")
12135 return Operator(
"broadcast_logical_xor")
12339 static const char *Cast_storageStypeValues[] = {
12345 .
SetParam(
"stype", Cast_storageStypeValues[
int(stype)])
12408 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12409 bool keepdims =
false,
12410 bool exclude =
false) {
12443 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12444 bool keepdims =
false,
12445 bool exclude =
false) {
12478 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12479 bool keepdims =
false,
12480 bool exclude =
false) {
12515 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12516 bool keepdims =
false,
12517 bool exclude =
false) {
12552 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12553 bool keepdims =
false,
12554 bool exclude =
false) {
12587 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12588 bool keepdims =
false,
12589 bool exclude =
false) {
12622 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12623 bool keepdims =
false,
12624 bool exclude =
false) {
12735 dmlc::optional<Shape> lhs_axes = dmlc::optional<Shape>(),
12736 dmlc::optional<Shape> rhs_axes = dmlc::optional<Shape>()) {
12790 dmlc::optional<Shape> axis = dmlc::optional<Shape>(),
12792 bool keepdims =
false) {
12793 static const char *NormOutDtypeValues[] = {
12805 .
SetParam(
"out_dtype", NormOutDtypeValues[
int(out_dtype)])
13211 bool global_pool =
false,
13212 bool cudnn_off =
false,
13216 dmlc::optional<int> p_value = dmlc::optional<int>(),
13217 dmlc::optional<bool> count_include_pad = dmlc::optional<bool>(),
13219 static const char *PoolingPoolTypeValues[] = {
13225 static const char *PoolingPoolingConventionValues[] = {
13230 static const char *PoolingLayoutValues[] = {
13241 .
SetParam(
"pool_type", PoolingPoolTypeValues[
int(pool_type)])
13242 .
SetParam(
"global_pool", global_pool)
13244 .
SetParam(
"pooling_convention", PoolingPoolingConventionValues[
int(pooling_convention)])
13248 .
SetParam(
"count_include_pad", count_include_pad)
13249 .
SetParam(
"layout", PoolingLayoutValues[
int(layout)])
13288 dmlc::optional<double> temperature = dmlc::optional<double>(),
13290 static const char *SoftmaxDtypeValues[] = {
13298 .
SetParam(
"temperature", temperature)
13299 .
SetParam(
"dtype", SoftmaxDtypeValues[
int(dtype)])
13339 dmlc::optional<double> temperature = dmlc::optional<double>(),
13341 static const char *SoftminDtypeValues[] = {
13349 .
SetParam(
"temperature", temperature)
13350 .
SetParam(
"dtype", SoftminDtypeValues[
int(dtype)])
13380 dmlc::optional<double> temperature = dmlc::optional<double>(),
13382 static const char *Log_softmaxDtypeValues[] = {
13390 .
SetParam(
"temperature", temperature)
13391 .
SetParam(
"dtype", Log_softmaxDtypeValues[
int(dtype)])
13428 uint32_t num_filter,
13434 uint32_t num_group = 1,
13435 uint64_t workspace = 512,
13436 bool no_bias =
true,
13438 bool cudnn_off =
false,
13440 static const char *DeconvolutionCudnnTuneValues[] = {
13443 "limited_workspace",
13446 static const char *DeconvolutionLayoutValues[] = {
13456 .
SetParam(
"num_filter", num_filter)
13461 .
SetParam(
"target_shape", target_shape)
13465 .
SetParam(
"cudnn_tune", DeconvolutionCudnnTuneValues[
int(cudnn_tune)])
13467 .
SetParam(
"layout", DeconvolutionLayoutValues[
int(layout)])
13494 static const char *ActivationActTypeValues[] = {
13502 .
SetParam(
"act_type", ActivationActTypeValues[
int(act_type)])
13579 double eps = 0.0010000000474974513,
13581 bool fix_gamma =
true,
13582 bool use_global_stats =
false,
13583 bool output_mean_var =
false,
13585 bool cudnn_off =
false) {
13590 .
SetParam(
"use_global_stats", use_global_stats)
13591 .
SetParam(
"output_mean_var", output_mean_var)
13597 .
SetInput(
"moving_mean", moving_mean)
13598 .
SetInput(
"moving_var", moving_var)
13671 bool use_data_lengths =
false,
13672 bool use_label_lengths =
false,
13674 static const char *CTCLossBlankLabelValues[] = {
13679 .
SetParam(
"use_data_lengths", use_data_lengths)
13680 .
SetParam(
"use_label_lengths", use_label_lengths)
13681 .
SetParam(
"blank_label", CTCLossBlankLabelValues[
int(blank_label)])
13684 .
SetInput(
"data_lengths", data_lengths)
13685 .
SetInput(
"label_lengths", label_lengths)
13735 bool no_bias =
false,
13736 bool flatten =
true) {
13738 .
SetParam(
"num_hidden", num_hidden)
13847 uint32_t num_filter,
13851 uint32_t num_group = 1,
13852 uint64_t workspace = 1024,
13853 bool no_bias =
false,
13855 bool cudnn_off =
false,
13857 static const char *ConvolutionCudnnTuneValues[] = {
13860 "limited_workspace",
13863 static const char *ConvolutionLayoutValues[] = {
13873 .
SetParam(
"num_filter", num_filter)
13880 .
SetParam(
"cudnn_tune", ConvolutionCudnnTuneValues[
int(cudnn_tune)])
13882 .
SetParam(
"layout", ConvolutionLayoutValues[
int(layout)])
13958 int num_filter = 0,
13960 uint64_t workspace = 512) {
13961 static const char *UpSamplingSampleTypeValues[] = {
13965 static const char *UpSamplingMultiInputModeValues[] = {
13971 .
SetParam(
"sample_type", UpSamplingSampleTypeValues[
int(sample_type)])
13973 .
SetParam(
"num_filter", num_filter)
13974 .
SetParam(
"multi_input_mode", UpSamplingMultiInputModeValues[
int(multi_input_mode)])
14077 bool output_mean_var =
false) {
14081 .
SetParam(
"output_mean_var", output_mean_var)
14172 dmlc::optional<bool> cudnn_off = dmlc::optional<bool>(0)) {
14173 static const char *DropoutModeValues[] = {
14179 .
SetParam(
"mode", DropoutModeValues[
int(mode)])
14220 static const char *SoftmaxActivationModeValues[] = {
14224 return Operator(
"SoftmaxActivation")
14225 .
SetParam(
"mode", SoftmaxActivationModeValues[
int(mode)])
14259 dmlc::optional<Shape> axes = dmlc::optional<Shape>(),
14260 bool keepdims =
false) {
14302 mx_float upper_bound = 0.333999991) {
14303 static const char *LeakyReLUActTypeValues[] = {
14312 .
SetParam(
"act_type", LeakyReLUActTypeValues[
int(act_type)])
14314 .
SetParam(
"lower_bound", lower_bound)
14315 .
SetParam(
"upper_bound", upper_bound)
14401 uint32_t state_size,
14402 uint32_t num_layers,
14404 bool bidirectional =
false,
14406 bool state_outputs =
false,
14407 dmlc::optional<int> projection_size = dmlc::optional<int>(),
14408 dmlc::optional<double> lstm_state_clip_min = dmlc::optional<double>(),
14409 dmlc::optional<double> lstm_state_clip_max = dmlc::optional<double>(),
14410 bool lstm_state_clip_nan =
false,
14411 bool use_sequence_length =
false) {
14412 static const char *RNNModeValues[] = {
14419 .
SetParam(
"state_size", state_size)
14420 .
SetParam(
"num_layers", num_layers)
14421 .
SetParam(
"mode", RNNModeValues[
int(mode)])
14422 .
SetParam(
"bidirectional", bidirectional)
14424 .
SetParam(
"state_outputs", state_outputs)
14425 .
SetParam(
"projection_size", projection_size)
14426 .
SetParam(
"lstm_state_clip_min", lstm_state_clip_min)
14427 .
SetParam(
"lstm_state_clip_max", lstm_state_clip_max)
14428 .
SetParam(
"lstm_state_clip_nan", lstm_state_clip_nan)
14429 .
SetParam(
"use_sequence_length", use_sequence_length)
14431 .
SetInput(
"parameters", parameters)
14433 .
SetInput(
"state_cell", state_cell)
14434 .
SetInput(
"sequence_length", sequence_length)
14536 bool multi_output =
false,
14537 bool use_ignore =
false,
14538 bool preserve_shape =
false,
14540 bool out_grad =
false,
14542 static const char *SoftmaxOutputNormalizationValues[] = {
14548 .
SetParam(
"grad_scale", grad_scale)
14549 .
SetParam(
"ignore_label", ignore_label)
14550 .
SetParam(
"multi_output", multi_output)
14551 .
SetParam(
"use_ignore", use_ignore)
14552 .
SetParam(
"preserve_shape", preserve_shape)
14553 .
SetParam(
"normalization", SoftmaxOutputNormalizationValues[
int(normalization)])
14555 .
SetParam(
"smooth_alpha", smooth_alpha)
14590 uint32_t dim2 = 0) {
14662 bool fix_gamma =
true,
14663 bool use_global_stats =
false,
14664 bool output_mean_var =
false) {
14669 .
SetParam(
"use_global_stats", use_global_stats)
14670 .
SetParam(
"output_mean_var", output_mean_var)
14715 return Operator(
"softmax_cross_entropy")
14752 return Operator(
"LinearRegressionOutput")
14753 .
SetParam(
"grad_scale", grad_scale)
14791 return Operator(
"MAERegressionOutput")
14792 .
SetParam(
"grad_scale", grad_scale)
14836 return Operator(
"LogisticRegressionOutput")
14837 .
SetParam(
"grad_scale", grad_scale)
14852 mx_float sparseness_target = 0.100000001,
14854 mx_float momentum = 0.899999976) {
14855 return Operator(
"IdentityAttachKLSparseReg")
14856 .
SetParam(
"sparseness_target", sparseness_target)
14899 .
SetParam(
"rescale_grad", rescale_grad)
14900 .
SetParam(
"clip_gradient", clip_gradient)
14952 .
SetParam(
"rescale_grad", rescale_grad)
14953 .
SetParam(
"clip_gradient", clip_gradient)
14982 nnvm::Tuple<mx_float> lrs,
14983 nnvm::Tuple<mx_float> wds,
14986 int num_weights = 1) {
14987 return Operator(
"multi_sgd_update")
14990 .
SetParam(
"rescale_grad", rescale_grad)
14991 .
SetParam(
"clip_gradient", clip_gradient)
14992 .
SetParam(
"num_weights", num_weights)
15031 nnvm::Tuple<mx_float> lrs,
15032 nnvm::Tuple<mx_float> wds,
15036 int num_weights = 1) {
15037 return Operator(
"multi_sgd_mom_update")
15041 .
SetParam(
"rescale_grad", rescale_grad)
15042 .
SetParam(
"clip_gradient", clip_gradient)
15043 .
SetParam(
"num_weights", num_weights)
15069 nnvm::Tuple<mx_float> lrs,
15070 nnvm::Tuple<mx_float> wds,
15073 int num_weights = 1) {
15074 return Operator(
"multi_mp_sgd_update")
15077 .
SetParam(
"rescale_grad", rescale_grad)
15078 .
SetParam(
"clip_gradient", clip_gradient)
15079 .
SetParam(
"num_weights", num_weights)
15118 nnvm::Tuple<mx_float> lrs,
15119 nnvm::Tuple<mx_float> wds,
15123 int num_weights = 1) {
15124 return Operator(
"multi_mp_sgd_mom_update")
15128 .
SetParam(
"rescale_grad", rescale_grad)
15129 .
SetParam(
"clip_gradient", clip_gradient)
15130 .
SetParam(
"num_weights", num_weights)
15168 bool lazy_update =
true) {
15172 .
SetParam(
"rescale_grad", rescale_grad)
15173 .
SetParam(
"clip_gradient", clip_gradient)
15174 .
SetParam(
"lazy_update", lazy_update)
15231 bool lazy_update =
true) {
15236 .
SetParam(
"rescale_grad", rescale_grad)
15237 .
SetParam(
"clip_gradient", clip_gradient)
15238 .
SetParam(
"lazy_update", lazy_update)
15266 bool lazy_update =
true) {
15270 .
SetParam(
"rescale_grad", rescale_grad)
15271 .
SetParam(
"clip_gradient", clip_gradient)
15272 .
SetParam(
"lazy_update", lazy_update)
15304 bool lazy_update =
true) {
15305 return Operator(
"mp_sgd_mom_update")
15309 .
SetParam(
"rescale_grad", rescale_grad)
15310 .
SetParam(
"clip_gradient", clip_gradient)
15311 .
SetParam(
"lazy_update", lazy_update)
15362 double epsilon = 9.9999999392252903e-09,
15373 .
SetParam(
"rescale_grad", rescale_grad)
15438 mx_float epsilon = 9.99999994e-09,
15442 bool lazy_update =
true) {
15449 .
SetParam(
"rescale_grad", rescale_grad)
15450 .
SetParam(
"clip_gradient", clip_gradient)
15451 .
SetParam(
"lazy_update", lazy_update)
15500 .
SetParam(
"rescale_grad", rescale_grad)
15501 .
SetParam(
"clip_gradient", clip_gradient)
15535 return Operator(
"mp_nag_mom_update")
15539 .
SetParam(
"rescale_grad", rescale_grad)
15540 .
SetParam(
"clip_gradient", clip_gradient)
15605 mx_float epsilon = 9.99999994e-09,
15615 .
SetParam(
"rescale_grad", rescale_grad)
15616 .
SetParam(
"clip_gradient", clip_gradient)
15617 .
SetParam(
"clip_weights", clip_weights)
15676 mx_float epsilon = 9.99999994e-09,
15681 return Operator(
"rmspropalex_update")
15687 .
SetParam(
"rescale_grad", rescale_grad)
15688 .
SetParam(
"clip_gradient", clip_gradient)
15689 .
SetParam(
"clip_weights", clip_weights)
15751 .
SetParam(
"rescale_grad", rescale_grad)
15752 .
SetParam(
"clip_gradient", clip_gradient)
15833 bool squeeze_axis =
false) {
15835 .
SetParam(
"num_outputs", num_outputs)
15837 .
SetParam(
"squeeze_axis", squeeze_axis)
15940 double constant_value = 0) {
15941 static const char *PadModeValues[] = {
15947 .
SetParam(
"mode", PadModeValues[
int(mode)])
15949 .
SetParam(
"constant_value", constant_value)
16027 static const char *GridGeneratorTransformTypeValues[] = {
16032 .
SetParam(
"transform_type", GridGeneratorTransformTypeValues[
int(transform_type)])
16033 .
SetParam(
"target_shape", target_shape)
16091 bool global_pool =
false,
16095 static const char *Pooling_v1PoolTypeValues[] = {
16100 static const char *Pooling_v1PoolingConventionValues[] = {
16106 .
SetParam(
"pool_type", Pooling_v1PoolTypeValues[
int(pool_type)])
16107 .
SetParam(
"global_pool", global_pool)
16108 .
SetParam(
"pooling_convention", Pooling_v1PoolingConventionValues[
int(pooling_convention)])
16148 uint32_t num_filter,
16152 uint32_t num_group = 1,
16153 uint64_t workspace = 1024,
16154 bool no_bias =
false,
16156 bool cudnn_off =
false,
16158 static const char *Convolution_v1CudnnTuneValues[] = {
16161 "limited_workspace",
16164 static const char *Convolution_v1LayoutValues[] = {
16173 .
SetParam(
"num_filter", num_filter)