operators.json 272.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
[
{
 "type" : "sgd",
 "comment" : "\n\nSGD operator\n\nThis operator implements one step of the stochastic gradient descent algorithm.\n\n$$param\\_out = param - learning\\_rate * grad$$\n\n",
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor) Learning rate of SGD",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
30 31
},{
 "type" : "print",
32
 "comment" : "\nCreates a print op that will print when a tensor is accessed.\n\nWraps the tensor passed in so that whenever that a tensor is accessed,\nthe message `message` is printed, along with the current value of the\ntensor `t`.",
33 34
 "inputs" : [ 
 { 
35 36 37 38 39 40 41 42 43
   "name" : "In",
   "comment" : "Input tensor to be displayed.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output tensor with same data as input tensor.",
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "first_n",
   "type" : "int",
   "comment" : "Only log `first_n` number of times.",
   "generated" : 0
 }, { 
   "name" : "message",
   "type" : "string",
   "comment" : "A string message to print as a prefix.",
   "generated" : 0
 }, { 
   "name" : "summarize",
   "type" : "int",
61
   "comment" : "Number of elements printed.",
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
   "generated" : 0
 }, { 
   "name" : "print_tensor_name",
   "type" : "bool",
   "comment" : "Whether to print the tensor name.",
   "generated" : 0
 }, { 
   "name" : "print_tensor_type",
   "type" : "bool",
   "comment" : "Whether to print the tensor's dtype.",
   "generated" : 0
 }, { 
   "name" : "print_tensor_shape",
   "type" : "bool",
   "comment" : "Whether to print the tensor's shape.",
   "generated" : 0
 }, { 
   "name" : "print_tensor_lod",
   "type" : "bool",
   "comment" : "Whether to print the tensor's lod.",
   "generated" : 0
83 84 85 86 87
 }, { 
   "name" : "print_phase",
   "type" : "string",
   "comment" : "(string, default 'BOTH') Which phase to display including 'FORWARD' 'BACKWARD' and 'BOTH'.",
   "generated" : 0
88
 } ] 
89 90
},{
 "type" : "adagrad",
91
 "comment" : "\n\nAdaptive Gradient Algorithm (Adagrad).\n\nThe update is done as follows:\n\n$$moment\\_out = moment + grad * grad \\\\\nparam\\_out = param - \\frac{learning\\_rate * grad}{\\sqrt{moment\\_out} + \\epsilon}\n$$\n\nThe original paper(http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\ndoes not have the epsilon attribute. It is added here in our implementation\nas also proposed here: http://cs231n.github.io/neural-networks-3/#ada\nfor numerical stability to avoid the division by zero error.\n\n",
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment",
   "comment" : "(Tensor) Second moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor) Learning rate",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MomentOut",
   "comment" : "(Tensor) Output second moment",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1.0e-6) Constant for numerical stability",
   "generated" : 0
 } ] 
},{
 "type" : "max_pool3d_with_index",
 "comment" : "\nMaxPool3d Operator.\n\nThe maxpooling3d with index operation calculates the output and the mask\nbased on the input and ksize, strides, paddings parameters.\nInput(X) and output(Out, Mask) are in NCDHW format, where N is batch\nsize, C is the number of channels, and D, H and W are the depth, height and\nwidth of the feature, respectively. \nParameters(ksize, strides, paddings) are three elements.\nThese three elements represent depth, height and width, respectively.\nThe input(X) size and output(Out, Mask) size may be different.\n\nExample:\n  Input:\n       X shape: $(N, C, D_{in}, H_{in}, W_{in})$\n  Output:\n       Out shape: $(N, C, D_{out}, H_{out}, W_{out})$\n       Mask shape: $(N, C, D_{out}, H_{out}, W_{out})$\n  Where\n       $$\n       D_{out} = \\frac{(D_{in} - ksize[0] + 2 * paddings[0])}{strides[0]} + 1 \\\\\n       H_{out} = \\frac{(H_{in} - ksize[1] + 2 * paddings[1])}{strides[1]} + 1 \\\\\n       W_{out} = \\frac{(W_{in} - ksize[2] + 2 * paddings[2])}{strides[2]} + 1\n       $$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of pooling operator. The format of input tensor is NCDHW, where N is batch size, C is the number of channels, and D, H and W are the depth, height and width of the image, respectively",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of pooling operator. The format of output tensor is also NCDHW, where N is the batch size, C is the number of channels, and D, H and W are the depth, height and width of the image, respectively.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Mask",
   "comment" : "(Tensor) The Mask tensor of pooling operator. The format of output tensor is also NCDHW, where N is the batch size, C is the number of channels, and D, H and W are the depth, height and width of the image, respectively. It represents the index in the current feature map.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "ksize",
   "type" : "int array",
   "comment" : "(vector<int>) The pooling window size(depth, height, width) of pooling operator. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "global_pooling",
   "type" : "bool",
   "comment" : "(bool, default false) Whether to use the global pooling. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int>, default {1,1,1}), strides(depth, height, width) of pooling operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector, default {0,0,0}), paddings(depth, height, width) of pooling operator. If global_pooling = true, paddings and ksize will be ignored.",
   "generated" : 0
 } ] 
},{
 "type" : "lod_rank_table",
 "comment" : "Create LoDRanTable by LoDTensor\n\nLoD Rank Table stores the `level` of `lod` which is ordered by sequence\nlength in descending order. It is useful when implement dynamic RNN and is\nshared by dynamic RNN memory, dynamic RNN slice input and dynamic RNN slice\noutput operators.\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) input lod tensor, must contain lod information.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDRankTable) The rank table of specific level.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "level",
   "type" : "int",
   "comment" : "(int) the specific lod level to rank.",
   "generated" : 0
 } ] 
},{
 "type" : "array_to_lod_tensor",
 "comment" : "This Op build a big LoDTensor from a std::vector<LoDTensor> \n          and a LoDRankTable. It is supposed to be used in getting dynamic RNN's\n          outputs back to a normal LoDTensor. The std::vector<LoDTensor> \n          would be the output of RNN Op and the LoDRankTable would be build \n          with RNN's input.",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(std::vector<LodTensor>) A vector of tensors that is going to be casted to a big LoDTensor.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "RankTable",
   "comment" : "(LoDRankTable) RankTable provides the coarse lod infomation to build the output LoDTensor. See 'paddle/framework/lod_rank_table.h' for more details.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) The LoDTensor formed by input tensor array.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "sequence_conv",
 "comment" : "\nSequence Conv Operator.\n\nSequenceConvOp performs convolution operation on features of contextLength\ntime-steps of each instance. The convolution operation calculates the output\nbased on the input, filter, strides and paddings parameters.\nThe size of each dimension of the parameters is checked during infer-shape.\nIn order to ensure the equal length of sequence before and after convolution,\nit is necessary to fill the top and bottom of each sequence based on\ncontext_length, context_stride and context_start.\n\n    ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) the input(X) is a LodTensor, which supports variable-time length input sequence. The underlying tensor in this LoDTensor is a matrix with shape (T, N), where T is the total time steps in this mini-batch and N is the input_hidden_size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "PaddingData",
   "comment" : "(Tensor, optional) the input(PaddingData) is an optional parameter, and it is learnable. This is a tensor with shape (P, N), where P is the top_pad + bottom_pad, N is the input_hidden_size. In order to ensure the equal length of sequence before and after convolution, it is necessary to fill the top and bottom of each sequence according to context_length, context_stride and context_start",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Filter",
   "comment" : "(Tensor) the input(Filter) is an learnable parameter.This is a tensor with shape (K, M), where K is the context_length * input_hidden_size, M is the output feature size.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) the output(Out) is a LodTensor, which support variable-time length output sequence. The underlying tensor in this LoDTensor is a matrix with shape (T, M), where, T is the total time steps in this mini-batch, M is the output feature size.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "paddingTrainable",
   "type" : "bool",
   "comment" : "(bool, default:false) the padding data of SequenceConvOp is trainable or not.",
   "generated" : 0
 }, { 
   "name" : "contextLength",
   "type" : "int",
   "comment" : "(int) the contextLength of SequenceConvOp is the height of the convolution kernel.",
   "generated" : 0
 }, { 
   "name" : "contextStart",
   "type" : "int",
   "comment" : "(int, default:0) the contextStart of SequenceConvOp represents the beginning of the convolution of the number of rows of sequence, which can be negative. The negative number means to pad contextStart time-steps of zeros or learnable parameters at the beginning of each instance. The positive number means to skip contextStart time-steps of each instance.",
   "generated" : 0
 }, { 
   "name" : "contextStride",
   "type" : "int",
   "comment" : "(int, default:1) the contextStride of SequenceConvOp represents the stride length of convolution kernel. Currently, SequenceConvOp only supportscontextStride=1.",
   "generated" : 0
 } ] 
},{
 "type" : "lstm",
 "comment" : "\nLong-Short Term Memory (LSTM) Operator.\n\nThe defalut implementation is diagonal/peephole connection\n(https://arxiv.org/pdf/1402.1128.pdf), the formula is as follows:\n\n$$\ni_t = \\sigma(W_{ix}x_{t} + W_{ih}h_{t-1} + W_{ic}c_{t-1} + b_i) \\\\\n\nf_t = \\sigma(W_{fx}x_{t} + W_{fh}h_{t-1} + W_{fc}c_{t-1} + b_f) \\\\\n\n\\tilde{c_t} = act_g(W_{cx}x_t + W_{ch}h_{t-1} + b_c) \\\\\n\no_t = \\sigma(W_{ox}x_{t} + W_{oh}h_{t-1} + W_{oc}c_t + b_o) \\\\\n\nc_t = f_t \\odot c_{t-1} + i_t \\odot \\tilde{c_t} \\\\\n\nh_t = o_t \\odot act_h(c_t)\n$$\n\nwhere the W terms denote weight matrices (e.g. $W_{xi}$ is the matrix\nof weights from the input gate to the input), $W_{ic}, W_{fc}, W_{oc}$\nare diagonal weight matrices for peephole connections. In our implementation,\nwe use vectors to reprenset these diagonal weight matrices. The b terms\ndenote bias vectors ($b_i$ is the input gate bias vector), $\\sigma$\nis the non-line activations, such as logistic sigmoid function, and\n$i, f, o$ and $c$ are the input gate, forget gate, output gate,\nand cell activation vectors, respectively, all of which have the same size as\nthe cell output activation vector $h$.\n\nThe $\\odot$ is the element-wise product of the vectors. $act_g$ and $act_h$\nare the cell input and cell output activation functions and `tanh` is usually\nused for them. $\\tilde{c_t}$ is also called candidate hidden state,\nwhich is computed based on the current input and the previous hidden state.\n\nSet `use_peepholes` False to disable peephole connection. The formula\nis omitted here, please refer to the paper\nhttp://www.bioinf.jku.at/publications/older/2604.pdf for details.\n\nNote that these $W_{xi}x_{t}, W_{xf}x_{t}, W_{xc}x_{t}, W_{xo}x_{t}$\noperations on the input $x_{t}$ are NOT included in this operator.\nUsers can choose to use fully-connect operator before LSTM operator.\n\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(LoDTensor) the first input is a LodTensor, which support variable-time length input sequence. The underlying tensor in this LoDTensor is a matrix with shape (T X 4D), where T is the total time steps in this mini-batch, D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "H0",
   "comment" : "(Tensor, optional) the initial hidden state is an optional input. This is a tensor with shape (N x D), where N is the batch size and D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "C0",
289
   "comment" : "(Tensor, optional) the initial cell state is an optional input. This is a tensor with shape (N x D), where N is the batch size. `H0` and `C0` can be NULL but only at the same time.",
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(Tensor) the learnable hidden-hidden weights. - The shape is (D x 4D), where D is the hidden size.  - Weight = {W_ch, W_ih, W_fh, W_oh}",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor) the learnable weights, which contains two parts: input-hidden bias weight and peephole connections weight if setting `use_peepholes` True. 1. `use_peepholes = False`  - The shape is (1 x 4D).  - Bias = {b_c, b_i, b_f, b_o}.2. `use_peepholes = True`  - The shape is (1 x 7D).  - Bias = {b_c, b_i, b_f, b_o, W_ic, W_fc, W_oc}.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Hidden",
   "comment" : "(LoDTensor) the hidden state of LSTM operator. The shape is (T x D), and lod is the same with the `Input`.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Cell",
   "comment" : "(LoDTensor) the cell state of LSTM operator. The shape is (T x D), and lod is the same with the `Input`.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "BatchGate",
   "comment" : "(LoDTensor) This LoDTensor contains input gate, forget gate and output gate after the nonlinear computation. This LoDTensor has the same shape as the reorganized input, which is also be called batch input. The LoD size is 2. The first LoD is the batch offsets and the second LoD contains the indexes, which denote the position of reorganized sequence in the raw input.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "BatchCellPreAct",
   "comment" : "(LoDTensor) This LoDTensor is obtained in the forward and used in the backward.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [ 
 { 
   "name" : "use_peepholes",
   "type" : "bool",
   "comment" : "(bool, defalut: True) whether to enable diagonal/peephole connections.",
   "generated" : 0
 }, { 
   "name" : "is_reverse",
   "type" : "bool",
   "comment" : "(bool, defalut: False) whether to compute reversed LSTM.",
   "generated" : 0
 }, { 
   "name" : "gate_activation",
   "type" : "string",
   "comment" : "(string, default: sigmoid)The activation for input gate, forget gate and output gate, `sigmoid` by default.",
   "generated" : 0
 }, { 
   "name" : "cell_activation",
   "type" : "string",
   "comment" : "(string, default: tanh)The activation for cell output, `tanh` by defalut.",
   "generated" : 0
 }, { 
   "name" : "candidate_activation",
   "type" : "string",
   "comment" : "(string, default: tanh)The activation for candidate hidden state, `tanh` by default.",
   "generated" : 0
 } ] 
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
},{
 "type" : "lstmp",
 "comment" : "\nLong-Short Term Memory with recurrent Projection layer (LSTMP) Operator.\n\nLSTMP has a separate projection layer after the LSTM layer, projecting the \noriginal hidden state to a lower-dimensional one, which is proposed to reduce \nthe number of total parameters and furthermore computational complexity for \nthe LSTM, espeacially for the case that the size of output units is relative \nlarge (https://research.google.com/pubs/archive/43905.pdf). \n\nThe formula is as follows:\n\n$$\ni_t = \\sigma(W_{ix}x_{t} + W_{ir}r_{t-1} + W_{ic}c_{t-1} + b_i) \\\\\n\nf_t = \\sigma(W_{fx}x_{t} + W_{fr}r_{t-1} + W_{fc}c_{t-1} + b_f) \\\\\n\n\\tilde{c_t} = act_g(W_{cx}x_t + W_{cr}r_{t-1} + b_c) \\\\\n\no_t = \\sigma(W_{ox}x_{t} + W_{or}r_{t-1} + W_{oc}c_t + b_o) \\\\\n\nc_t = f_t \\odot c_{t-1} + i_t \\odot \\tilde{c_t} \\\\\n\nh_t = o_t \\odot act_h(c_t) \\\\\n\nr_t = \\overline{act_h}(W_{rh}h_t)\n$$\n\nwhere the W terms denote weight matrices (e.g. $W_{xi}$ is the matrix\nof weights from the input gate to the input), $W_{ic}, W_{fc}, W_{oc}$\nare diagonal weight matrices for peephole connections. In our implementation,\nwe use vectors to reprenset these diagonal weight matrices. The b terms\ndenote bias vectors ($b_i$ is the input gate bias vector), $\\sigma$\nis the activation, such as logistic sigmoid function, and\n$i, f, o$ and $c$ are the input gate, forget gate, output gate,\nand cell activation vectors, respectively, all of which have the same size as\nthe cell output activation vector $h$. Here $h$ is usually called the hidden \nstate and $r$ denotes its recurrent projection. And $\\tilde{c_t}$ is also \ncalled the candidate hidden state, whose computation is based on the current \ninput and previous hidden state.\n\nThe $\\odot$ is the element-wise product of the vectors. $act_g$ and $act_h$\nare the cell input and cell output activation functions and `tanh` is usually\nused for them. $\\overline{act_h}$ is the activation function for the \nprojection output, usually using `identity` or same as $act_h$.\n\nNote that these $W_{xi}x_{t}, W_{xf}x_{t}, W_{xc}x_{t}, W_{xo}x_{t}$\noperations on the input $x_{t}$ are NOT included in this operator.\nUsers can choose to use fully-connected operator before LSTMP operator.\n\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(LoDTensor) the input for sequence data, which supports variable-time length input sequence. The underlying tensor in this LoDTensor is a matrix with shape (T X 4D), where T is the total time steps in this mini-batch, D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "H0",
   "comment" : "(Tensor, optional) the initial hidden state is an optional input. This is a tensor with shape (N x D), where N is the batch size and D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "C0",
   "comment" : "(Tensor, optional) the initial cell state is an optional input. This is a tensor with shape (N x D), where N is the batch size. `C0` should not be null if `H0` provided.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(Tensor) the learnable hidden-hidden weights. - The shape is (P x 4D), where P is the projection layer size and  D is the hidden size. - Weight = {W_cr, W_ir, W_fr, W_or}",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "ProjWeight",
   "comment" : "(Tensor) the learnable weight of the projection layer. - The shape is (D x P), where P is the recurrent projection layer size and  D is the hidden size. - ProjWeight = {W_rh}",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor) the learnable biases, which contains two parts: input-hidden biases and peephole connections weights if setting `use_peepholes` to `True`. 1. `use_peepholes = False`  - The shape is (1 x 4D).  - Bias = {b_c, b_i, b_f, b_o}.2. `use_peepholes = True`  - The shape is (1 x 7D).  - Bias = {b_c, b_i, b_f, b_o, W_ic, W_fc, W_oc}.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Projection",
   "comment" : "(LoDTensor) the projection of the hidden state of LSTMP operator. The shape is (T x P), and LoD is the same with the `Input`.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Cell",
   "comment" : "(LoDTensor) the cell state of LSTMP operator. The shape is (T x D), and lod is the same with the `Input`.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "BatchGate",
   "comment" : "(LoDTensor) This LoDTensor contains input gate, forget gate and output gate after the activations. This LoDTensor has the same shape as the reorganized input, which is also be called batch input. The LoD size is 2. The first-level LoD is the batch offsets and the second contains the indices, which denotes the position of reorganized sequence in the raw input.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "BatchCellPreAct",
   "comment" : "(LoDTensor) the pre-activation cell state reorganized in batch. This LoDTensor is obtained in the forward and used in the backward.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "BatchHidden",
   "comment" : "(LoDTensor) the hidden state reorganized in batch. This LoDTensor is obtained in the forward and used in the backward.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "OrderedP0",
   "comment" : "(Tensor) the projection of the initial hidden state H0. This is a tensor with shape (N x P), where N is the batch size and P is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [ 
 { 
   "name" : "use_peepholes",
   "type" : "bool",
   "comment" : "(bool, defalut: True) whether to enable diagonal/peephole connections.",
   "generated" : 0
 }, { 
   "name" : "is_reverse",
   "type" : "bool",
   "comment" : "(bool, defalut: False) whether to compute reversed LSTMP.",
   "generated" : 0
 }, { 
   "name" : "gate_activation",
   "type" : "string",
   "comment" : "(string, default: sigmoid)The activation for input gate, forget gate and output gate, `sigmoid` by default.",
   "generated" : 0
 }, { 
   "name" : "cell_activation",
   "type" : "string",
   "comment" : "(string, default: tanh)The activation for cell output, `tanh` by defalut.",
   "generated" : 0
 }, { 
   "name" : "candidate_activation",
   "type" : "string",
   "comment" : "(string, default: tanh)The activation for candidate hidden state, `tanh` by default.",
   "generated" : 0
 }, { 
   "name" : "proj_activation",
   "type" : "string",
   "comment" : "(string, default: tanh)The activation for projection output, `tanh` by defalut.",
   "generated" : 0
 } ] 
451
},{
452 453
 "type" : "warpctc",
 "comment" : "\nAn operator integrating the open-source\n[warp-ctc](https://github.com/baidu-research/warp-ctc) library, which is used in\n[Deep Speech 2: End-toEnd Speech Recognition in English and Mandarin](\nhttps://arxiv.org/pdf/1512.02595v1.pdf),\nto compute Connectionist Temporal Classification (CTC) loss.\nIt can be aliased as softmax with ctc, since a native softmax activation is\ninterated to the warp-ctc library, to to normlize values for each row of the\ninput tensor.\n\nMore detail of CTC loss can be found by refering to\n[Connectionist Temporal Classification: Labelling Unsegmented Sequence Data with\nRecurrent Neural Networks](\nhttp://machinelearning.wustl.edu/mlpapers/paper_files/icml2006_GravesFGS06.pdf).\n",
454 455
 "inputs" : [ 
 { 
456 457 458
   "name" : "Logits",
   "comment" : "(LodTensor, default: LoDTensor<float>), the unscaled probabilities of variable-length sequences, which is a 2-D Tensor with LoD information. It's shape is [Lp, num_classes + 1], where Lp is the sum of all input sequences' length and num_classes is the true number of classes (not including the blank label).",
   "duplicable" : 0,
459 460
   "intermediate" : 0
 }, { 
461 462 463
   "name" : "Label",
   "comment" : "(LodTensor, default: LoDTensor<int>), the ground truth of variable-length sequence, which is a 2-D Tensor with LoD information. It is of the shape [Lg, 1], where Lg is th sum of all labels' length.",
   "duplicable" : 0,
464 465 466 467
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
468 469 470 471
   "name" : "WarpCTCGrad",
   "comment" : "(Tensor, default: Tensor<float>), a temporary output Tensor to store the gradients of warp-ctc, which is computed with loss together in one call. It is a 3-D Tensor of the shape [max_sequence_length, batch_size, num_classes + 1].",
   "duplicable" : 0,
   "intermediate" : 1
472
 }, { 
473 474
   "name" : "Loss",
   "comment" : "(Tensor, default: Tensor<float>), the Connectionist Temporal Classification (CTC) loss, which is a 2-D Tensor of the shape [batch_size, 1]",
475 476 477 478 479
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
480 481 482
   "name" : "blank",
   "type" : "int",
   "comment" : "(int, default: 0), the blank label of Connectionist Temporal Classification (CTC) loss, which is in the half-opened interval [0, num_classes + 1).",
483 484
   "generated" : 0
 }, { 
485 486 487
   "name" : "norm_by_times",
   "type" : "bool",
   "comment" : "(bool, default: false), whether to normalize the gradients by the number of time-step, which is also the sequence's length.",
488
   "generated" : 0
489 490 491 492 493 494 495 496 497 498
 } ] 
},{
 "type" : "cos_sim",
 "comment" : "\nCosine Similarity Operator.\n\n$Out = X^T * Y / (\\sqrt{X^T * X} * \\sqrt{Y^T * Y})$\n\nThe input X and Y must have the same shape, except that the 1st dimension\nof input Y could be just 1 (different from input X), which will be\nbroadcasted to match the shape of input X before computing their cosine\nsimilarity.\n\nBoth the input X and Y can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input X.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The 1st input of cos_sim op.",
   "duplicable" : 0,
   "intermediate" : 0
499
 }, { 
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
   "name" : "Y",
   "comment" : "The 2nd input of cos_sim op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of cos_sim op.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "XNorm",
   "comment" : "Norm of the first input, reduced along the 1st dimension.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "YNorm",
   "comment" : "Norm of the second input, reduced along the 1st dimension.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [  ] 
},{
 "type" : "conv3d",
 "comment" : "\nConvolution3D Operator.\n\nThe convolution operation calculates the output based on the input, filter\nand strides, paddings, dilations, groups parameters. The size of each dimension of the\nparameters is checked in the infer-shape.\nInput(Input) and output(Output) are in NCDHW format, where N is batch\nsize, C is the number of channels,D is the depth of the feature, H is the height of\nthe feature, and W is the width of the feature.\nFilters(Input) is MCDHW format, where M is the number of output image channels,\nC is the number of input image channels, D is the depth of the filter,\nH is the height of the filter, and W is the width of the filter.\nParameters(strides, paddings, dilations) are three elements. These three elements\nrepresent depth, height and width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:\n  Input:\n       Input shape: $(N, C_{in}, D_{in}, H_{in}, W_{in})$\n       Filter shape: $(C_{out}, C_{in}, D_f, H_f, W_f)$\n  Output:\n       Output shape: $(N, C_{out}, D_{out}, H_{out}, W_{out})$\n  Where\n  $$\n       D_{out}= \\frac{(D_{in} + 2 * paddings[0] - (dilations[0] * (D_f - 1) + 1))}{ strides[0]}+ 1 \\\\\n       H_{out}= \\frac{(H_{in} + 2 * paddings[1] - (dilations[1] * (H_f - 1) + 1))}{ strides[1]}+ 1 \\\\\n       W_{out}= \\frac{(W_{in} + 2 * paddings[2] - (dilations[2] * (W_f - 1) + 1))}{ strides[2]}+ 1\n  $$\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) The input tensor of convolution operator. The format of input tensor is NCDHW. Where N is batch size, C is the number of channels, D is the depth of the feature, H is the height of the feature, and W is the width of the feature.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Filter",
   "comment" : "(Tensor) The filter tensor of convolution operator. The format of the filter tensor is MCDHW, where M is the number of output image channels, C is the number of input image channels, D is the depth of the filter, H is the height of the filter, and W is the width of the filter.If the groups attribute is greater than 1, C equals the number of input image channels divided by the groups.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Output",
   "comment" : "(Tensor) The output tensor of convolution operator.The format of output tensor is also NCDHW.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int>, default:{1, 1, 1}), the strides(d_stride, h_stride, w_stride) of convolution operator.",
550 551
   "generated" : 0
 }, { 
552 553 554
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int>, default:{0, 0, 0}), the paddings(d_pad, h_pad, w_pad) of convolution operator.",
555 556
   "generated" : 0
 }, { 
557 558 559 560 561 562 563 564 565 566 567
   "name" : "groups",
   "type" : "int",
   "comment" : "(int default:1), the groups number of the convolution operator. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels.",
   "generated" : 0
 }, { 
   "name" : "dilations",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1, 1}), the dilations(d_dilation, h_dilation, w_dilation) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
568
   "type" : "bool",
569 570 571 572 573 574 575 576 577 578 579
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 }, { 
   "name" : "workspace_size_MB",
   "type" : "int",
   "comment" : "Only used in cudnn kernel. workspace size for cudnn, in MB, workspace is a section of GPU memory which will be allocated/freed each time the operator runs, larger workspace size can increase performance but also requires better hardware. This size should be chosen carefully.",
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638
   "generated" : 0
 } ] 
},{
 "type" : "depthwise_conv2d",
 "comment" : "\nConvolution Operator.\n\nThe convolution operation calculates the output based on the input, filter\nand strides, paddings, dilations, groups parameters. The size of each dimension of the\nparameters is checked in the infer-shape.\nInput(Input) and Output(Output) are in NCHW format. Where N is batch\nsize, C is the number of channels, H is the height of the feature, and W is\nthe width of the feature.\nFilters(Input) is MCHW format. Where M is the number of output image channels, C is\nthe number of input image channels, H is the height of the filter, and W\nis the width of the filter.\nParameters(strides, paddings, dilations) are two elements. These two elements represent\nheight and width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:\n  Input:\n       Input shape: $(N, C_{in}, H_{in}, W_{in})$\n       Filter shape: $(C_{out}, C_{in}, H_f, W_f)$\n  Output:\n       Output shape: $(N, C_{out}, H_{out}, W_{out})$\n  Where\n$$\n       H_{out}= \\frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (H_f - 1) + 1))}{strides[0]}+ 1 \\\\\n       W_{out}= \\frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (W_f - 1) + 1))}{strides[1]}+ 1\n$$\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) The input tensor of convolution operator. The format of input tensor is NCHW, where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Filter",
   "comment" : "(Tensor) The filter tensor of convolution operator. The format of the filter tensor is MCHW, where M is the number of output image channels, C is the number of input image channels, H is the height of the filter, and W is the width of the filter. If the groups attribute is greater than 1, C equals the number of input image channels divided by the groups.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Output",
   "comment" : "(Tensor) The output tensor of convolution operator. The format of output tensor is also NCHW.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the strides(h_stride, w_stride) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int> default:{0, 0}), the paddings(h_pad, w_pad) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "groups",
   "type" : "int",
   "comment" : "(int default:1), the groups number of the convolution operator. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels.",
   "generated" : 0
 }, { 
   "name" : "dilations",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the dilations(h_dilation, w_dilation) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
   "type" : "bool",
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 }, { 
   "name" : "workspace_size_MB",
   "type" : "int",
   "comment" : "Only used in cudnn kernel. Need set use_cudnn to true.workspace size for cudnn, in MB, workspace is a section of GPU memory which will be allocated/freed each time the operator runs, larger workspace size can increase performance but also requires better hardware. This size should be chosen carefully.",
639 640
   "generated" : 0
 } ] 
641
},{
642 643
 "type" : "conv2d",
 "comment" : "\nConvolution Operator.\n\nThe convolution operation calculates the output based on the input, filter\nand strides, paddings, dilations, groups parameters. The size of each dimension of the\nparameters is checked in the infer-shape.\nInput(Input) and Output(Output) are in NCHW format. Where N is batch\nsize, C is the number of channels, H is the height of the feature, and W is\nthe width of the feature.\nFilters(Input) is MCHW format. Where M is the number of output image channels, C is\nthe number of input image channels, H is the height of the filter, and W\nis the width of the filter.\nParameters(strides, paddings, dilations) are two elements. These two elements represent\nheight and width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:\n  Input:\n       Input shape: $(N, C_{in}, H_{in}, W_{in})$\n       Filter shape: $(C_{out}, C_{in}, H_f, W_f)$\n  Output:\n       Output shape: $(N, C_{out}, H_{out}, W_{out})$\n  Where\n$$\n       H_{out}= \\frac{(H_{in} + 2 * paddings[0] - (dilations[0] * (H_f - 1) + 1))}{strides[0]}+ 1 \\\\\n       W_{out}= \\frac{(W_{in} + 2 * paddings[1] - (dilations[1] * (W_f - 1) + 1))}{strides[1]}+ 1\n$$\n",
644 645
 "inputs" : [ 
 { 
646 647
   "name" : "Input",
   "comment" : "(Tensor) The input tensor of convolution operator. The format of input tensor is NCHW, where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature.",
648 649 650
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
651 652
   "name" : "Filter",
   "comment" : "(Tensor) The filter tensor of convolution operator. The format of the filter tensor is MCHW, where M is the number of output image channels, C is the number of input image channels, H is the height of the filter, and W is the width of the filter. If the groups attribute is greater than 1, C equals the number of input image channels divided by the groups.",
653 654 655 656 657
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
658 659
   "name" : "Output",
   "comment" : "(Tensor) The output tensor of convolution operator. The format of output tensor is also NCHW.",
660 661 662 663 664
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
665 666 667 668 669 670 671 672 673 674 675
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the strides(h_stride, w_stride) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int> default:{0, 0}), the paddings(h_pad, w_pad) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "groups",
676
   "type" : "int",
677
   "comment" : "(int default:1), the groups number of the convolution operator. According to grouped convolution in Alex Krizhevsky's Deep CNN paper: when group=2, the first half of the filters is only connected to the first half of the input channels, while the second half of the filters is only connected to the second half of the input channels.",
678 679
   "generated" : 0
 }, { 
680 681 682 683 684 685
   "name" : "dilations",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the dilations(h_dilation, w_dilation) of convolution operator.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
686
   "type" : "bool",
687 688 689 690 691 692 693 694 695 696 697
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 }, { 
   "name" : "workspace_size_MB",
   "type" : "int",
   "comment" : "Only used in cudnn kernel. Need set use_cudnn to true.workspace size for cudnn, in MB, workspace is a section of GPU memory which will be allocated/freed each time the operator runs, larger workspace size can increase performance but also requires better hardware. This size should be chosen carefully.",
698 699
   "generated" : 0
 } ] 
700
},{
701 702
 "type" : "pool3d",
 "comment" : "\nPool3d Operator.\n\nThe pooling3d operation calculates the output based on\nthe input, pooling_type, ksize, strides, and paddings parameters.\nInput(X) and output(Out) are in NCDHW format, where N is batch\nsize, C is the number of channels, and D, H and W are the depth, height and\nwidth of the feature, respectively. Parameters(ksize, strides, paddings) \nare three elements. These three elements represent depth, height and \nwidth, respectively. The input(X) size and output(Out) size may be different.\n\nExample:\n  Input:\n       X shape: $(N, C, D_{in}, H_{in}, W_{in})$\n  Output:\n       Out shape: $(N, C, D_{out}, H_{out}, W_{out})$\n  Where\n  $$\n       D_{out} = \\frac{(D_{in} - ksize[0] + 2 * paddings[0])}{strides[0]} + 1 \\\\\n       H_{out} = \\frac{(H_{in} - ksize[1] + 2 * paddings[1])}{strides[1]} + 1 \\\\\n       W_{out} = \\frac{(W_{in} - ksize[2] + 2 * paddings[2])}{strides[2]} + 1\n  $$\n\n",
703 704 705
 "inputs" : [ 
 { 
   "name" : "X",
706
   "comment" : "(Tensor) The input tensor of pooling operator. The format of input tensor is NCDHW, where N is batch size, C is the number of channels, and D, H and W is the depth, height and width of the feature, respectively.",
707 708
   "duplicable" : 0,
   "intermediate" : 0
709 710 711 712 713 714 715 716 717 718 719 720 721 722
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of pooling operator.The format of output tensor is also NCDHW, where N is batch size, C is the number of channels, and D, H and W is the depth, height and width of the feature, respectively.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "pooling_type",
   "type" : "string",
   "comment" : "(string) Pooling type, can be \"max\" for max-pooling and \"avg\" for average-pooling.",
   "generated" : 0
723
 }, { 
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
   "name" : "ksize",
   "type" : "int array",
   "comment" : "(vector<int>) The pooling window size(depth, height, width) of pooling operator. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "global_pooling",
   "type" : "bool",
   "comment" : "(bool, default false) Whether to use the global pooling. If global_pooling = true, ksize and paddings wille be ignored.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int>, default {1,1,1}) Strides(depth, height, width) of the pooling operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int>, default {0,0,0}), paddings(depth, height, width) of pooling operator. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
   "type" : "bool",
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 } ] 
},{
 "type" : "pool2d",
 "comment" : "\nPool2d Operator.\n\nThe pooling2d operation calculates the output based on\nthe input, pooling_type and ksize, strides, paddings parameters.\nInput(X) and output(Out) are in NCHW format, where N is batch size, C is the\nnumber of channels, H is the height of the feature, and W is the width of the feature.\nParameters(ksize, strides, paddings) are two elements.\nThese two elements represent height and width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:   \n  Input:\n       X shape: $(N, C, H_{in}, W_{in})$\n  Output:\n       Out shape: $(N, C, H_{out}, W_{out})$\n  Where\n       $$ \n       H_{out} = \\frac{(H_{in} - ksize[0] + 2 * paddings[0])}{strides[0]} + 1 \\\\\n       W_{out} = \\frac{(W_{in} - ksize[1] + 2 * paddings[1])}{strides[1]} + 1\n       $$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of pooling operator. The format of input tensor is NCHW, where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature.",
761 762 763 764 765 766
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
767
   "comment" : "(Tensor) The output tensor of pooling operator. The format of output tensor is also NCHW, where N is batch size, C is the number of channels, H is the height of the feature, and W is the width of the feature.",
768 769
   "duplicable" : 0,
   "intermediate" : 0
770 771 772 773 774 775 776
 } ], 
 "attrs" : [ 
 { 
   "name" : "pooling_type",
   "type" : "string",
   "comment" : "(string), pooling type, can be \"max\" for max-pooling and \"avg\" for average-pooling.",
   "generated" : 0
777
 }, { 
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
   "name" : "ksize",
   "type" : "int array",
   "comment" : "(vector<int>) The pooling window size(height, width) of the pooling operator. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "global_pooling",
   "type" : "bool",
   "comment" : "(bool, default false) Whether to use the global pooling. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int>, default {1, 1}), strides(height, width) of pooling operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int>, default {0,0}), paddings(height, width) of pooling operator.If global_pooling = true, paddings and ksize will be ignored.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
   "type" : "bool",
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 } ] 
},{
 "type" : "conv3d_transpose",
810
 "comment" : "\nConvolution3D Transpose Operator.\n\nThe convolution transpose operation calculates the output based on the input, filter\nand dilations, strides, paddings, groups parameters. The size of each dimension of the\nparameters is checked in the infer-shape.\nInput(Input) and output(Output) are in NCDHW format. Where N is batch size, C is the\nnumber of channels, D is the depth of the feature, H is the height of the feature,\nand W is the width of the feature.\nFilter(Input) is in MCDHW format. Where M is the number of input feature channels,\nC is the number of output feature channels, D is the depth of the filter,H is the\nheight of the filter, and W is the width of the filter.\nParameters(strides, paddings) are three elements. These three elements represent\ndepth, height and width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:   \n  Input:\n       Input shape: $(N, C_{in}, D_{in}, H_{in}, W_{in})$\n       Filter shape: $(C_{in}, C_{out}, D_f, H_f, W_f)$\n  Output:\n       Output shape: $(N, C_{out}, D_{out}, H_{out}, W_{out})$\n  Where\n  $$\n       D_{out} = (D_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (D_f - 1) + 1 \\\\\n       H_{out} = (H_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (H_f - 1) + 1 \\\\\n       W_{out} = (W_{in} - 1) * strides[2] - 2 * paddings[2] + dilations[2] * (W_f - 1) + 1\n  $$\n",
811 812 813 814
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) The input tensor of convolution transpose operator.The format of input tensor is NCDHW. Where N is batch size, C is the number of channels, D is the depth of the feature, H is the height of the feature, and W is the width of the feature.",
815
   "duplicable" : 0,
816
   "intermediate" : 0
817
 }, { 
818 819
   "name" : "Filter",
   "comment" : "(Tensor) The filter tensor of convolution transpose operator.The format of the filter tensor is MCDHW, where M is the number of input feature channels, C is the number of output feature channels, D is the depth of the filter, H is the height of the filter, and W is the width of the filter.We enforce groups number == 1 and padding == 0 in the convolution3d transpose scenario.",
820
   "duplicable" : 0,
821
   "intermediate" : 0
822
 } ], 
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
 "outputs" : [ 
 { 
   "name" : "Output",
   "comment" : "(Tensor) The output tensor of convolution transpose operator.The format of output tensor is also NCDHW.Where N is batch size, C is the number of channels, D is the depth of the feature, H is the height of the feature, and W is the width of the feature.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "dilations",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1, 1}), the dilations(d_dilation,h_dilation, w_dilation) of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1, 1}), the strides{d_stride, h_stride, w_stride} of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int> default:{0, 0, 0}), paddings(d_pad, h_pad, w_pad) of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
   "type" : "bool",
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 }, { 
   "name" : "workspace_size_MB",
   "type" : "int",
   "comment" : "Used in cudnn kernel only. workspace size for cudnn, in MB, workspace is a section of GPU memory which will be allocated/freed each time the operator runs, larger workspace size can increase performance but also requires better hardward. This size should be carefully setted.",
   "generated" : 0
 } ] 
862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
},{
 "type" : "parallel_do",
 "comment" : "\nParallelDo Operator.\n",
 "inputs" : [ 
 { 
   "name" : "inputs",
   "comment" : "",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "parameters",
   "comment" : "",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "places",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "outputs",
   "comment" : "",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "parallel_scopes",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "sub_block",
   "type" : "block id",
   "comment" : "",
   "generated" : 0
 } ] 
901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959
},{
 "type" : "recurrent",
 "comment" : "\nStatic Length Recurrent Operator.\n\nThe static length recurrent operator can only operate on fixed size sequence\ndata, i.e. in each mini-batch, the sequence length of all inputs are the same.\n\n",
 "inputs" : [ 
 { 
   "name" : "inputs",
   "comment" : "rnn inputs",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "initial_states",
   "comment" : "rnn initial states",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "parameters",
   "comment" : "Parameters are used by step block as its input. However, the input is not a sequence tensor. Every time step, each operator in step block just use the parameter directly.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "outputs",
   "comment" : "The output sequence of RNN. The sequence length must be same.",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "step_scopes",
   "comment" : "StepScopes contain all local variables in each time step.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "ex_states",
   "type" : "string array",
   "comment" : "The ex-state variable names.\nThe ex-state means the state value in the ex-timestep or the previous time step\n[ex_states, states, initial_states@GRAD] must be the same order",
   "generated" : 0
 }, { 
   "name" : "states",
   "type" : "string array",
   "comment" : "The state variable names. [ex_states, states, initial_states@GRAD] must be the same order",
   "generated" : 0
 }, { 
   "name" : "sub_block",
   "type" : "block id",
   "comment" : "The step block inside RNN",
   "generated" : 0
 }, { 
   "name" : "reverse",
   "type" : "bool",
   "comment" : "Calculate RNN reversely or not.\nBy default reverse=False\n\nAssume the input data is [A, B, C, D]\n\nif reverse is False:\n  the computation of RNN is like\n      A          B          C         D\n      |          |          |         |\n      v          v          v         v\n     rnn -----> rnn -----> rnn ----> rnn\n      |          |          |         |\n      v          v          v         v\n      o          o          o         o\n\nif reverse is True\n  the computation of RNN is like\n      A          B          C         D\n      |          |          |         |\n      v          v          v         v\n     rnn <----- rnn <----- rnn <---- rnn\n      |          |          |         |\n      v          v          v         v\n      o          o          o         o\n",
   "generated" : 0
 }, { 
   "name" : "is_train",
   "type" : "bool",
   "comment" : "",
   "generated" : 0
 } ] 
960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
},{
 "type" : "save",
 "comment" : "\nSave operator\n\nThis operator will serialize and write a tensor variable to file on disk.\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor ) Input tensor to be saved",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [  ], 
 "attrs" : [ 
 { 
   "name" : "overwrite",
   "type" : "bool",
   "comment" : "(boolean, default true)Overwrite the output file if exist",
   "generated" : 0
 }, { 
   "name" : "file_path",
   "type" : "string",
   "comment" : "(string)The \"file_path\" where the variable will be saved.",
   "generated" : 0
 } ] 
},{
 "type" : "load",
 "comment" : "\nLoad Operator.\n\nLoad operator will load a tensor variable from disk file.\n\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The tensor need to be loaded",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "file_path",
   "type" : "string",
   "comment" : "(string) Variable will be loaded from \"file_path\".",
   "generated" : 0
 } ] 
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
},{
 "type" : "load_combine",
 "comment" : "\nLoadCombine Operator.\n\nLoadCombine operator loads LoDTensor variables from a file. The file should \ncontain one or more LoDTensors serialized using the SaveCombine operator. The \nLoadCombine operator applies a deserialization strategy to appropriately load \nthe LodTensors, and this strategy complements the serialization strategy used \nin the SaveCombine operator. Hence, the LoadCombine operator is tightly coupled\nwith the SaveCombine operator, and can only deserialize one or more LoDTensors \nthat were saved using the SaveCombine operator.\n\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(vector) The output LoDTensors that will be read from the input file.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "file_path",
   "type" : "string",
   "comment" : "(string) LoDTensors will be loaded from \"file_path\".",
   "generated" : 0
 } ] 
1019
},{
1020 1021
 "type" : "accuracy",
 "comment" : "\nAccuracy Operator. \n\nIt will print accuracy rate for classification.\nThe accuracy is calculated as follows:\n\n$$accuracy = \\frac{NumOfCorrectPredicts}{NumOfAllSamples}$$\n\nBoth the input Out and Label can carry the LoD (Level of Details)\ninformation, or not. But the output only shares the LoD information \nwith the input Out(Inference).\n\n",
1022 1023 1024
 "inputs" : [ 
 { 
   "name" : "Out",
1025
   "comment" : "The network output of topk (inferences)",
1026 1027 1028 1029
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Indices",
1030
   "comment" : "The the network output of topk (indices)",
1031 1032 1033 1034
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
1035
   "comment" : "Label of the training data",
1036 1037 1038 1039 1040
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1041 1042
   "name" : "Accuracy",
   "comment" : "The accuracy of current batch",
1043 1044 1045
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056
   "name" : "Correct",
   "comment" : "The correct samples count of current batch",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Total",
   "comment" : "The samples count of current batch",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1057 1058
},{
 "type" : "hard_sigmoid",
1059
 "comment" : "\nHardSigmoid Activation Operator.\n\nSegment-wise linear approximation of sigmoid(https://arxiv.org/abs/1603.00391), \nwhich is much faster than sigmoid.\n\n$out = \\max(0, \\min(1, slope * x + shift))$\n\nThe slope should be positive. The offset can be either positive or negative.\nThe default slope and shift are set according to the above reference.\nIt is recommended to use the defaults for this activation.\n\n",
1060 1061 1062 1063 1064 1065 1066 1067 1068
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of HardSigmoid operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1069
   "name" : "Out",
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164
   "comment" : "Output of HardSigmoid operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "slope",
   "type" : "float",
   "comment" : "Slope for linear approximation of sigmoid",
   "generated" : 0
 }, { 
   "name" : "offset",
   "type" : "float",
   "comment" : "Offset for linear approximation of sigmoid",
   "generated" : 0
 } ] 
},{
 "type" : "cond",
 "comment" : "\nSample Dependent Conditional Operator.\n\nGiven Cond[i] as a 1/0 vector to indicate true/false:\nOut[i] = subnet_true[i], if Cond[i] == true\nOut[i] = subnet_false[i], if Cond[i] == false\n\n",
 "inputs" : [ 
 { 
   "name" : "Cond",
   "comment" : "The condition, which is a bool vector",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Xs",
   "comment" : "Inputs of Subnets",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Outs",
   "comment" : "Outputs of Cond_Op after merge",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "SubScopes",
   "comment" : "sub scopes for true and false branches",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "IndexTensors",
   "comment" : "Index Tensors contains indices for true/false",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "max_pool2d_with_index",
 "comment" : "\nMaxPool2d Operator.\n\nThe maxPooling2d with index operation calculates the output and the mask\nbased on the input, ksize, strides, and paddings parameters. Input(X) and\noutput(Out, Mask) are in NCHW format, where N is batch size, C is the\nnumber of channels, H is the height of the feature, \nand W is the width of the feature.\nParameters(ksize, strides, paddings) are two elements.\nThese two elements represent height and width, respectively.\nThe input(X) size and output(Out, Mask) size may be different.\n\nExample:\n  Input:\n       X shape: $(N, C, H_{in}, W_{in})$\n  Output:\n       Out shape: $(N, C, H_{out}, W_{out})$\n       Mask shape: $(N, C, H_{out}, W_{out})$\n  Where\n       $$\n       H_{out} = \\frac{(H_{in} - ksize[0] + 2 * paddings[0])}{strides[0]} + 1 \\\\\n       W_{out} = \\frac{(W_{in} - ksize[1] + 2 * paddings[1])}{strides[1]} + 1\n       $$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of pooling operator. The format of input tensor is NCHW, where N is batch size, C is the number of channels, H is the height of the image, and W is the width of the image.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of pooling operator. The format of output tensor is also NCHW, where N is batch size, C is the number of channels, H is the height of the image and W is the width of the image.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Mask",
   "comment" : "(Tensor) The Mask tensor of pooling operator.The format of output tensor is also NCHW, where N is batch size, C is the number of channels, H is the height of the image, and W is the width of the image. It represents the index in the current feature map.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "ksize",
   "type" : "int array",
   "comment" : "(vector<int>) The pooling window size(height, width) of pooling operator. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "global_pooling",
   "type" : "bool",
   "comment" : "(bool, default:false) Whether to use the global pooling. If global_pooling = true, ksize and paddings will be ignored.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int>, default {1, 1}), strides(height, width) of pooling operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int>, default:{0, 0}), paddings(height, width) of pooling operator. If global_pooling = true, paddings and will be ignored.",
   "generated" : 0
 } ] 
},{
 "type" : "thresholded_relu",
1165
 "comment" : "\nThresholdedRelu Activation Operator.\n\n$$\nout = \\begin{cases} \n    x, \\text{if } x > threshold \\\\\n    0,  \\text{otherwise}\n    \\end{cases}\n$$\n\n",
1166 1167 1168 1169 1170 1171 1172 1173 1174
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of ThresholdedRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1175
   "name" : "Out",
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
   "comment" : "Output of ThresholdedRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "threshold",
   "type" : "float",
   "comment" : "The threshold location of activation",
   "generated" : 0
 } ] 
},{
 "type" : "hard_shrink",
1189
 "comment" : "\nHardShrink Activation Operator.\n\n$$\nout = \\begin{cases} \n    x, \\text{if } x > \\lambda \\\\\n    x, \\text{if } x < -\\lambda \\\\\n    0,  \\text{otherwise}\n    \\end{cases}\n$$\n\n",
1190 1191 1192 1193 1194 1195 1196 1197 1198
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of HardShrink operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1199
   "name" : "Out",
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212
   "comment" : "Output of HardShrink operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "threshold",
   "type" : "float",
   "comment" : "The value of threshold for HardShrink",
   "generated" : 0
 } ] 
},{
 "type" : "relu6",
1213
 "comment" : "\nRelu6 Activation Operator.\n\n$out = \\min(\\max(0, x), 6)$\n\n",
1214 1215 1216 1217 1218 1219 1220 1221 1222
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Relu6 operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1223
   "name" : "Out",
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236
   "comment" : "Output of Relu6 operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "threshold",
   "type" : "float",
   "comment" : "The threshold value of Relu6",
   "generated" : 0
 } ] 
},{
 "type" : "elu",
1237
 "comment" : "\nELU Activation Operator.\n\nApplies the following element-wise computation on the input according to\nhttps://arxiv.org/abs/1511.07289.\n\n$out = \\max(0, x) + \\min(0, \\alpha * (e^x - 1))$\n\n",
1238 1239 1240 1241 1242 1243 1244 1245 1246
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of ELU operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1247
   "name" : "Out",
1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258
   "comment" : "Output of ELU operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "alpha",
   "type" : "float",
   "comment" : "The alpha value of ELU",
   "generated" : 0
 } ] 
1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281
},{
 "type" : "save_combine",
 "comment" : "\nSaveCombine operator\n\nThis operator will serialize and write a list of input LoDTensor variables \nto a file on disk.\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(vector) Input LoDTensors that need to be saved together in a file.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "outputs" : [  ], 
 "attrs" : [ 
 { 
   "name" : "overwrite",
   "type" : "bool",
   "comment" : "(boolean, default true)Overwrite the output file if it exists.",
   "generated" : 0
 }, { 
   "name" : "file_path",
   "type" : "string",
   "comment" : "(string)The \"file_path\" where the LoDTensor variables will be saved.",
   "generated" : 0
 } ] 
1282 1283
},{
 "type" : "leaky_relu",
1284
 "comment" : "\nLeakyRelu Activation Operator.\n\n$out = \\max(x, \\alpha * x)$\n\n",
1285 1286 1287 1288 1289 1290 1291 1292 1293
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of LeakyRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1294
   "name" : "Out",
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
   "comment" : "Output of LeakyRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "alpha",
   "type" : "float",
   "comment" : "The small negative slope",
   "generated" : 0
 } ] 
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323
},{
 "type" : "softsign",
 "comment" : "\nSoftsign Activation Operator.\n\n$$out = \\frac{x}{1 + |x|}$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Softsign operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Softsign operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1324
},{
1325 1326
 "type" : "square",
 "comment" : "\nSquare Activation Operator.\n\n$out = x^2$\n\n",
1327 1328 1329
 "inputs" : [ 
 { 
   "name" : "X",
1330
   "comment" : "Input of Square operator",
1331 1332 1333 1334 1335 1336
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1337
   "comment" : "Output of Square operator",
1338 1339 1340 1341
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
},{
 "type" : "log",
 "comment" : "\nLog Activation Operator.\n\n$out = \\ln(x)$\n\nNatural logarithm of x.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Log operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Log operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377
},{
 "type" : "reciprocal",
 "comment" : "\nReciprocal Activation Operator.\n\n$$out = \\frac{1}{x}$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Reciprocal operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Reciprocal operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395
},{
 "type" : "ceil",
 "comment" : "\nCeil Activation Operator.\n\n$out = ceil(x)$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Ceil operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Ceil operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413
},{
 "type" : "abs",
 "comment" : "\nAbs Activation Operator.\n\n$out = |x|$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Abs operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Abs operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1414
},{
1415 1416
 "type" : "softmax",
 "comment" : "\nSoftmax Operator.\n\nThe input of the softmax operator is a 2-D tensor with shape N x K (N is the\nbatch_size, K is the dimension of input feature). The output tensor has the\nsame shape as the input tensor.\n\nFor each row of the input tensor, the softmax operator squashes the\nK-dimensional vector of arbitrary real values to a K-dimensional vector of real\nvalues in the range [0, 1] that add up to 1.\nIt computes the exponential of the given dimension and the sum of exponential\nvalues of all the other dimensions in the K-dimensional vector input.\nThen the ratio of the exponential of the given dimension and the sum of\nexponential values of all the other dimensions is the output of the softmax\noperator.\n\nFor each row $i$ and each column $j$ in Input(X), we have:\n    $$Out[i, j] = \\frac{\\exp(X[i, j])}{\\sum_j(exp(X[i, j])}$$\n\n",
1417 1418
 "inputs" : [ 
 { 
1419
   "name" : "X",
1420
   "comment" : "The input tensor of softmax. 2-D with shape [batch_size, input_feature_dimensions].",
1421 1422
   "duplicable" : 0,
   "intermediate" : 0
1423 1424 1425 1426
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1427
   "comment" : "The normalized values with the same shape as X.",
1428 1429
   "duplicable" : 0,
   "intermediate" : 0
1430 1431 1432 1433 1434 1435 1436 1437 1438
 } ], 
 "attrs" : [  ] 
},{
 "type" : "top_k",
 "comment" : "\nTop K operator\n\nIf the input is a vector (1d tensor), this operator finds the k largest \nentries in the vector and outputs their values and indices as vectors. \nThus values[j] is the j-th largest entry in input, and its index is indices[j].\n\nFor matrices, this operator computes the top k entries in each row. ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input of Topk op",
1439 1440 1441 1442 1443
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1444 1445
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of Topk op",
1446 1447 1448
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1449 1450
   "name" : "Indices",
   "comment" : "(Tensor) The indices of Topk elements of input",
1451 1452 1453 1454 1455
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
1456 1457 1458
   "name" : "k",
   "type" : "int",
   "comment" : "(int, default 1) Number of top elements to look for along the last dimension (along each row for matrices).",
1459 1460 1461
   "generated" : 0
 } ] 
},{
1462
 "type" : "clip",
1463
 "comment" : "\nClip Operator.\n\nThe clip operator limits the value of given input within an interval. The\ninterval is specified with arguments 'min' and 'max':\n\n$$\nOut = \\min(\\max(X, min), max)\n$$\n\n",
1464 1465 1466
 "inputs" : [ 
 { 
   "name" : "X",
1467
   "comment" : "(Tensor)The input of clip op.The number of dimensions must be between [1, 9].",
1468 1469 1470 1471 1472 1473
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1474
   "comment" : "(Tensor)The output of clip op with shape as input(X)",
1475 1476 1477 1478 1479
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
1480
   "name" : "min",
1481
   "type" : "float",
1482 1483 1484 1485 1486 1487
   "comment" : "(float)Minimum value, under which element is replaced by min.",
   "generated" : 0
 }, { 
   "name" : "max",
   "type" : "float",
   "comment" : "(float)Maximum value, above which element is replaced by max",
1488 1489 1490
   "generated" : 0
 } ] 
},{
1491 1492
 "type" : "margin_rank_loss",
 "comment" : "\nMarginRankLoss Operator.\n\nThis operator measures the loss given a pair of training sample\n{`X1`, `X2`} and the `Label` with attribute `margin`, where `Label = +1` \nindicating X1 is ranked higher than `X2` and `Label = -1` otherwise. The loss \nis calculated as:\n\n$loss(X1, X2, Label) = \\max(0, -Label * (X1 - X2) + margin)$\n\nThe attribute `margin` here helps make the predictions more robust.\nDenote the item ranked higher as the positive sample, otherwise the negative \nsample. If the score of the two samples satisfies \n\n$positive sample - negative sample < margin$\n\nthe pair of samples will contribute to the final loss, which will backpropagate \nand train the ranking model to enlarge the difference between the two scores.\n\nFor batch input with size `batch_size`, `X1`, `X2` and `Label`\nall have the same shape [batch_size x 1].\n\n",
1493 1494
 "inputs" : [ 
 { 
1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506
   "name" : "X1",
   "comment" : "(2-D tensor with shape [batch_size x 1]) The score for one item X1 to be ranked, from pairwise ranking model.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "X2",
   "comment" : "(2-D tensor with shape [batch_size x 1]) The score for another item X2 to be ranked, from pairwise ranking model.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(2-D tensor with shape [batch_size x 1]) The label indicating X1 ranked higher than X2 or not, can only be +1 or -1.",
1507 1508 1509 1510 1511
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1512 1513 1514 1515 1516
   "name" : "Activated",
   "comment" : "(2-D tensor with shape [batch_size x 1]) Intermediate tensor to indicate whether each element of Output(Out) is activated.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
1517
   "name" : "Out",
1518
   "comment" : "(2-D tensor with shape [batch_size x 1]) The output loss of MarginRankLoss operator.",
1519 1520 1521 1522 1523
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
1524
   "name" : "margin",
1525
   "type" : "float",
1526
   "comment" : "(scalar, default 0) Margin for MarginRankLossOp.",
1527 1528 1529
   "generated" : 0
 } ] 
},{
1530
 "type" : "mul",
1531
 "comment" : "\nMul Operator.\n\nThis operator is used to perform matrix multiplication for input $X$ and $Y$.\n\nThe equation is:\n\n$$Out = X * Y$$\n\nBoth the input $X$ and $Y$ can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input $X$.\n\n",
1532 1533 1534
 "inputs" : [ 
 { 
   "name" : "X",
1535
   "comment" : "(Tensor), The first input tensor of mul op.",
1536 1537 1538 1539
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
1540
   "comment" : "(Tensor), The second input tensor of mul op.",
1541 1542 1543 1544 1545 1546
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1547
   "comment" : "(Tensor), The output tensor of mul op.",
1548 1549 1550 1551 1552
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
1553 1554
   "name" : "x_num_col_dims",
   "type" : "int",
1555
   "comment" : "(int, default 1), The mul_op can take tensors with more than two\n              dimensions as its inputs. If the input $X$ is a tensor with more\n              than two dimensions, $X$ will be flattened into a two-dimensional\n              matrix first. The flattening rule is: the first `num_col_dims`\n              will be flattened to form the first dimension of the final matrix\n              (the height of the matrix), and the rest `rank(X) - num_col_dims`\n              dimensions are flattened to form the second dimension of the final\n              matrix (the width of the matrix). As a result, height of the\n              flattened matrix is equal to the product of $X$'s first\n              `x_num_col_dims` dimensions' sizes, and width of the flattened\n              matrix is equal to the product of $X$'s last `rank(x) - num_col_dims`\n              dimensions' size. For example, suppose $X$ is a 6-dimensional\n              tensor with the shape [2, 3, 4, 5, 6], and `x_num_col_dims` = 3.\n              Thus, the flattened matrix will have a shape [2 x 3 x 4, 5 x 6] =\n              [24, 30].\n        ",
1556 1557 1558 1559
   "generated" : 0
 }, { 
   "name" : "y_num_col_dims",
   "type" : "int",
1560
   "comment" : "(int, default 1), The mul_op can take tensors with more than two,\n              dimensions as its inputs. If the input $Y$ is a tensor with more\n              than two dimensions, $Y$ will be flattened into a two-dimensional\n              matrix first. The attribute `y_num_col_dims` determines how $Y$ is\n              flattened. See comments of `x_num_col_dims` for more details.\n        ",
1561 1562
   "generated" : 0
 } ] 
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
},{
 "type" : "mine_hard_examples",
 "comment" : "\nMine hard examples Operator.\nThis operator implements hard example mining to select a subset of negative box indices.\nFor each image, selects the box with highest losses. subject to the condition that the \nbox cannot have an Matcht > neg_dist_threshold when mining_type is max_negative. \nThe selected number is min(sample_size, max_negative_box_number) when mining_type is \nhard_example, or min(neg_pos_ratio * positive_box_number, max_negative_box_number) \nwhen mining_type is max_negative, where the max_negative_box_number is the count of \nMatchIndices elements with value -1.\n",
 "inputs" : [ 
 { 
   "name" : "ClsLoss",
   "comment" : "(Tensor, default Tensor<float>), The classification loss with shape [N, Np], N is the batch size and Np is the number of prior box.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LocLoss",
   "comment" : "(Tensor, optional, default Tensor<float>), The localization loss with shape [N, Np], N is the batch size and Np is the number of prior box.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MatchIndices",
   "comment" : "(Tensor, Tensor<int>), Matched indices with shape [N, Np], N is the batch size and Np is the number of prior box. MatchIndices[i][j] equal -1 means the j-th prior box in i-th instance does not match any entity, otherwise means it is matched to row.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MatchDist",
   "comment" : "(Tensor, default Tensor<float>) Matched indices with shape [N, Np], N is the batch size and Np is the number of prior box.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "NegIndices",
   "comment" : "(LoDTensor<int>) The output of negative example indices. a LoDTensor with shape [Neg, 1]. The size of lod[0] minus 1 is batch size, and each element is the prior box index. For example, the batch size is 2, the lod is [[0, 1, 2]], the sample 0's box 1(MatchIndices[0][1]) is selected, and sample 1's box 0 is selected. The output NegIndices is [[1], [0]].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "UpdatedMatchIndices",
   "comment" : "(Tensor<int>) The output of updated MatchIndices, a tensor with shape [N, Np]. Only update when mining_type is hard_example. The input MatchIndices elements will be update to -1 when it is not in the candidate high loss list of negative examples.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "neg_pos_ratio",
   "type" : "float",
   "comment" : "(float) The ratio of the negative box to the positive box. Use only when mining_type is max_negative.",
   "generated" : 0
 }, { 
   "name" : "neg_dist_threshold",
   "type" : "float",
   "comment" : "(float) The negative overlap upper bound for the unmatched predictions. Use only when mining_type is max_negative.",
   "generated" : 0
 }, { 
   "name" : "sample_size",
   "type" : "int",
   "comment" : "(float) The max sample size of negative box. Use only when mining_type is hard_example.",
   "generated" : 0
 }, { 
   "name" : "mining_type",
   "type" : "string",
   "comment" : "(float) The mining algorithm name, the value is hard_example or max_negative.",
   "generated" : 0
 } ] 
},{
 "type" : "swish",
 "comment" : "\nSwish Activation Operator.\n\n$$out = \\frac{x}{1 + e^{- \\beta x}}$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Swish operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Swish operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "beta",
   "type" : "float",
   "comment" : "Constant beta of swish operator",
   "generated" : 0
 } ] 
},{
 "type" : "is_empty",
 "comment" : "\nIsEmpty Operator which checks whether a tensor is empty.\n\nIt will just return product(tensor.ddims()) > 0;\n              ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) Tensor which is to be checked.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) a boolean Tensor that indicate empty or not.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1664
},{
1665 1666
 "type" : "minus",
 "comment" : "\nMinus Operator.\n\nEquation:\n\n    $Out = X - Y$\n\nBoth the input `X` and `Y` can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input `X`.\n\n",
1667 1668 1669
 "inputs" : [ 
 { 
   "name" : "X",
1670 1671 1672 1673 1674 1675
   "comment" : "The left tensor of minus operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "The right tensor of minus operator.",
1676 1677 1678 1679 1680 1681
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1682
   "comment" : "The output tensor of minus operator.",
1683 1684 1685 1686
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714
},{
 "type" : "scatter",
 "comment" : "\nScatter Operator.\n\nThis operator obtains output by updating the input on selected indices on the first axis:\n\n$$\nOut = Ref \\\\\nOut[Index] = Ref[Index] + Updates\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "Ref",
   "comment" : "The source input of scatter op",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Index",
   "comment" : "The index input of scatter op where Ref will be updated",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Updates",
   "comment" : "The updated value of updates op",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of add op",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755
},{
 "type" : "logical_and",
 "comment" : "logical_and Operator\n\nIt operates element-wise on X and Y, and returns the Out. X, Y and Out are N-dim boolean tensors.\nEach element of Out is calculated by $$Out = X \\&\\& Y$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) Left hand operand of logical_and operator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(LoDTensor) Right hand operand of logical_and operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is $$Out = X \\&\\& Y$$",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "logical_not",
 "comment" : "logical_not Operator\n\nIt operates element-wise on X, and returns the Out. X and Out are N-dim boolean tensors.\nEach element of Out is calculated by $$Out = !X$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) Operand of logical_not operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is $$Out = !X$$",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1756
},{
1757 1758
 "type" : "max_sequence_len",
 "comment" : "Calculate the max sequence length through lod_rank_table.",
1759 1760
 "inputs" : [ 
 { 
1761 1762
   "name" : "RankTable",
   "comment" : "The lod_rank_table.",
1763 1764 1765 1766 1767
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1768 1769 1770 1771 1772 1773
   "name" : "Out",
   "comment" : "The max sequence length.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
1774
},{
1775 1776
 "type" : "multiplex",
 "comment" : "\nMultiplex Operator.\n\nMultiplex multiple tensors according to the index provided by the index tensor.\n\nIds: the index tensor.\nX[0 : N - 1]: the candidate tensors for output (N >= 2).\nFor each index i from 0 to batchSize - 1, the output is the i-th row of the\nthe (Ids[i])-th tensor.\n\nFor i-th row of the output tensor:\n\n$$y[i] = x_{k}[i]$$\n\nwhere `y` is the output tensor, `x_{k}` is the k-th input tensor,\nand `k = Ids[i]`.\n\n",
1777 1778
 "inputs" : [ 
 { 
1779 1780
   "name" : "Ids",
   "comment" : "The index tensor of multiplex operator.",
1781 1782 1783
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1784 1785 1786
   "name" : "X",
   "comment" : "The candidate tensors of multiplex operator.",
   "duplicable" : 1,
1787 1788 1789 1790 1791
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1792
   "comment" : "The output tensor of multiplex operator.",
1793 1794 1795
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
1796
 "attrs" : [  ] 
1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825
},{
 "type" : "elementwise_pow",
 "comment" : "\nLimited Elementwise Pow Operator.\n\nThe equation is:\n\n$$Out = X ^ Y$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor), The first input tensor of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(Tensor), The second input tensor of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
   "generated" : 0
 } ] 
1826
},{
1827 1828
 "type" : "proximal_gd",
 "comment" : "\nProximalGD Operator.\n\nOptimizer that implements the proximal gradient descent algorithm:\n\n$$\nprox\\_param = param - learning\\_rate * grad \\\\\nparam = sign(prox\\_param) / (1 + learning\\_rate * l2) *\n        \\max(|prox\\_param| - learning\\_rate * l1, 0)\n$$        \n\nThe paper that proposed Proximal Gradient Descent:\n(http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting.pdf)\n\n",
1829 1830
 "inputs" : [ 
 { 
1831 1832
   "name" : "Param",
   "comment" : "(Tensor, default Tensor<float>) Input parameter value that has to be updated.",
1833 1834 1835
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1836 1837
   "name" : "Grad",
   "comment" : "(Tensor, default Tensor<float>) Input gradient of the parameter.",
1838 1839
   "duplicable" : 0,
   "intermediate" : 0
1840 1841 1842 1843 1844 1845 1846
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor, default Tensor<float>) The learning rate should be a tensor of size 1.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
1847
 { 
1848 1849
   "name" : "ParamOut",
   "comment" : "(Tensor) Output updated parameter value.",
1850 1851 1852 1853 1854
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
1855 1856 1857
   "name" : "l1",
   "type" : "float",
   "comment" : "(float, default 0.0) L1 regularization strength.",
1858 1859
   "generated" : 0
 }, { 
1860 1861 1862
   "name" : "l2",
   "type" : "float",
   "comment" : "(float, default 0.0) L2 regularization strength.",
1863 1864 1865
   "generated" : 0
 } ] 
},{
1866 1867
 "type" : "prelu",
 "comment" : "\nPRelu Operator.\n\nThe equation is:\n\n$$\nf(x) =\n\\begin{cases}\n\\alpha * x, \\quad  \\text{if} \\ x < 0 \\\\\nx,         \\qquad  \\text{if} \\ x >= 0\n\\end{cases}\n$$\n\nThe input `X` can carry the LoD (Level of Details) information,\nor not. And the output shares the LoD information with input `X`.\n\n",
1868 1869 1870
 "inputs" : [ 
 { 
   "name" : "X",
1871
   "comment" : "The input tensor of prelu operator.",
1872 1873 1874
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1875 1876
   "name" : "Alpha",
   "comment" : "The alpha weight of prelu operator.",
1877 1878 1879 1880 1881 1882
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
1883
   "comment" : "The output tensor of prelu operator.",
1884 1885 1886
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
1887
 "attrs" : [  ] 
1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961
},{
 "type" : "prior_box",
 "comment" : "\nPrior box operator\nGenerate prior boxes for SSD(Single Shot MultiBox Detector) algorithm.\nEach position of the input produce N prior boxes, N is determined by\n the count of min_sizes, max_sizes and aspect_ratios, The size of the\n box is in range(min_size, max_size) interval, which is generated in\n sequence according to the aspect_ratios.\n\nPlease get more information from the following papers:\nhttps://arxiv.org/abs/1512.02325.\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor, default Tensor<float>), the input feature data of PriorBoxOp, The layout is NCHW.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Image",
   "comment" : "(Tensor, default Tensor<float>), the input image data of PriorBoxOp, The layout is NCHW.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Boxes",
   "comment" : "(Tensor, default Tensor<float>), the output prior boxes of PriorBoxOp. The layout is [H, W, num_priors, 4]. H is the height of input, W is the width of input, num_priors is the box count of each position.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Variances",
   "comment" : "(Tensor, default Tensor<float>), the expanded variances of PriorBoxOp. The layout is [H, W, num_priors, 4]. H is the height of input, W is the width of input, num_priors is the box count of each position.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "min_sizes",
   "type" : "int array",
   "comment" : "(vector<int>) ",
   "generated" : 1
 }, { 
   "name" : "max_sizes",
   "type" : "int array",
   "comment" : "(vector<int>) ",
   "generated" : 1
 }, { 
   "name" : "aspect_ratios",
   "type" : "float array",
   "comment" : "(vector<float>) ",
   "generated" : 1
 }, { 
   "name" : "variances",
   "type" : "float array",
   "comment" : "(vector<float>) ",
   "generated" : 1
 }, { 
   "name" : "flip",
   "type" : "bool",
   "comment" : "(bool) ",
   "generated" : 1
 }, { 
   "name" : "clip",
   "type" : "bool",
   "comment" : "(bool) ",
   "generated" : 1
 }, { 
   "name" : "step_w",
   "type" : "float",
   "comment" : "Prior boxes step across width, 0 for auto calculation.",
   "generated" : 0
 }, { 
   "name" : "step_h",
   "type" : "float",
   "comment" : "Prior boxes step across height, 0 for auto calculation.",
   "generated" : 0
 }, { 
   "name" : "offset",
   "type" : "float",
   "comment" : "(float) Prior boxes center offset.",
   "generated" : 0
 } ] 
1962
},{
1963 1964
 "type" : "proximal_adagrad",
 "comment" : "\nProximal Adagrad Optimizer.\n\nOptimizer that implements the proximal adagrad algorithm:\n\n$$\nmoment = moment + grad * grad \\\\\nprox\\_param = param - learning\\_rate * grad * (1 / \\sqrt{moment}) \\\\\nparam = sign(prox\\_param) / (1 + learning\\_rate * l2) *\n        \\max(|prox\\_param| - learning\\_rate * l1 , 0)\n$$\n\nThe paper that proposed Proximal GD: \n(http://papers.nips.cc/paper/3793-efficient-learning-using-forward-backward-splitting.pdf)\nHere, we use the adagrad learning rate as specified here: \n(http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\n\n",
1965 1966
 "inputs" : [ 
 { 
1967 1968
   "name" : "Param",
   "comment" : "(Tensor, default Tensor<float>) Input parameter that has to be updated.",
1969 1970 1971
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1972 1973
   "name" : "Moment",
   "comment" : "(Tensor, default Tensor<float>) Moment parameter that has to be updated.",
1974 1975 1976
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
1977 1978 1979 1980 1981 1982 1983
   "name" : "Grad",
   "comment" : "(Tensor, default Tensor<float>) Input gradient of the parameter.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor, default Tensor<float>) The learning rate should be a tensor of size 1.",
1984 1985 1986 1987 1988
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
1989 1990
   "name" : "ParamOut",
   "comment" : "(Tensor) Output updated parameter value.",
1991
   "duplicable" : 0,
1992
   "intermediate" : 0
1993
 }, { 
1994 1995
   "name" : "MomentOut",
   "comment" : "(Tensor) Output updated moment value.",
1996 1997 1998 1999 2000
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
2001
   "name" : "l1",
2002
   "type" : "float",
2003
   "comment" : "(float, default 0.0) L1 regularization strength.",
2004 2005
   "generated" : 0
 }, { 
2006 2007 2008 2009 2010
   "name" : "l2",
   "type" : "float",
   "comment" : "(float, default 0.0) L2 regularization strength.",
   "generated" : 0
 } ] 
2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
},{
 "type" : "rank_loss",
 "comment" : "\nRankLoss Operator.\n\nRankLoss operator for RankNet\n(http://icml.cc/2015/wp-content/uploads/2015/06/icml_ranking.pdf). \nRankNet is a pairwise ranking model with\none training sample consisting of a pair of doc A and B, and the label P\nindicating that A is ranked higher than B or not:\n\nP = {0, 1} or {0, 0.5, 1}, where 0.5 means no information about the rank of\nthe input pair.\n\nThe RankLoss operator takes three inputs: Left (o_i), Right (o_j) and Label\n(P_{i,j}), which represent the output score of RankNet for the two docs and \nthe label respectively, and yields the rank loss C_{i,j} using the following \nequation:\n\n$$\n  C_{i,j} = -\\tilde{P_{ij}} * o_{i,j} + \\log(1 + e^{o_{i,j}}) \\\\\n  o_{i,j} =  o_i - o_j  \\\\\n  \\tilde{P_{i,j}} = \\left \\{0, 0.5, 1 \\right \\} \\ or \\ \\left \\{0, 1 \\right \\}\n$$\n\nThe operator can take batch inputs with size batch_size (batch_size >= 1).\n\n",
 "inputs" : [ 
 { 
   "name" : "Label",
   "comment" : "(2-D Tensor with shape [batch_size x 1]) The label indicating A ranked higher than B or not.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Left",
   "comment" : "(2-D Tensor with shape [batch_size x 1]) The output of RankNet for doc A.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Right",
   "comment" : "(2-D Tensor with shape [batch_size x 1]) The output of RankNet for doc B.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(2-D Tensor with shape [batch_size x 1]) The output loss of RankLoss operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
2039
},{
2040
 "type" : "reduce_min",
2041
 "comment" : "\nReduceMin Operator.\n\nThis operator computes the min of input tensor along the given dimension. \nThe result tensor has 1 fewer dimension than the input unless keep_dim is true.\nIf reduce_all is true, just reduce along all dimensions and output a scalar.\n\n",
2042 2043 2044
 "inputs" : [ 
 { 
   "name" : "X",
2045
   "comment" : "(Tensor) The input tensor. Tensors with rank at most 6 are supported.",
2046 2047 2048 2049 2050 2051
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
2052
   "comment" : "(Tensor) The result tensor.",
2053 2054 2055
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
2056 2057
 "attrs" : [ 
 { 
2058
   "name" : "dim",
2059
   "type" : "int",
2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070
   "comment" : "(int, default 0) The dimension to reduce. Must be in the range [-rank(input), rank(input)). If `dim < 0`, the dim to reduce is `rank + dim`. Note that reducing on the first dim will make the LoD info lost.",
   "generated" : 0
 }, { 
   "name" : "keep_dim",
   "type" : "bool",
   "comment" : "(bool, default false) If true, retain the reduced dimension with length 1.",
   "generated" : 0
 }, { 
   "name" : "reduce_all",
   "type" : "bool",
   "comment" : "(bool, default false) If true, output a scalar reduced along all dimensions.",
2071 2072
   "generated" : 0
 } ] 
2073 2074
},{
 "type" : "reduce_max",
2075
 "comment" : "\nReduceMax Operator.\n\nThis operator computes the max of input tensor along the given dimension. \nThe result tensor has 1 fewer dimension than the input unless keep_dim is true.\nIf reduce_all is true, just reduce along all dimensions and output a scalar.\n\n",
2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor. Tensors with rank at most 6 are supported.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The result tensor.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "dim",
   "type" : "int",
   "comment" : "(int, default 0) The dimension to reduce. Must be in the range [-rank(input), rank(input)). If `dim < 0`, the dim to reduce is `rank + dim`. Note that reducing on the first dim will make the LoD info lost.",
   "generated" : 0
 }, { 
   "name" : "keep_dim",
   "type" : "bool",
   "comment" : "(bool, default false) If true, retain the reduced dimension with length 1.",
   "generated" : 0
 }, { 
   "name" : "reduce_all",
   "type" : "bool",
   "comment" : "(bool, default false) If true, output a scalar reduced along all dimensions.",
   "generated" : 0
 } ] 
2107
},{
2108
 "type" : "reduce_mean",
2109
 "comment" : "\nReduceMean Operator.\n\nThis operator computes the mean of input tensor along the given dimension. \nThe result tensor has 1 fewer dimension than the input unless keep_dim is true.\nIf reduce_all is true, just reduce along all dimensions and output a scalar.\n\n",
2110 2111
 "inputs" : [ 
 { 
2112 2113
   "name" : "X",
   "comment" : "(Tensor) The input tensor. Tensors with rank at most 6 are supported.",
2114 2115 2116 2117 2118
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
2119 2120
   "name" : "Out",
   "comment" : "(Tensor) The result tensor.",
2121 2122 2123 2124 2125
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
2126
   "name" : "dim",
2127
   "type" : "int",
2128
   "comment" : "(int, default 0) The dimension to reduce. Must be in the range [-rank(input), rank(input)). If `dim < 0`, the dim to reduce is `rank + dim`. Note that reducing on the first dim will make the LoD info lost.",
2129 2130
   "generated" : 0
 }, { 
2131 2132 2133
   "name" : "keep_dim",
   "type" : "bool",
   "comment" : "(bool, default false) If true, retain the reduced dimension with length 1.",
2134 2135
   "generated" : 0
 }, { 
2136 2137 2138
   "name" : "reduce_all",
   "type" : "bool",
   "comment" : "(bool, default false) If true, output a scalar reduced along all dimensions.",
2139 2140
   "generated" : 0
 } ] 
2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158
},{
 "type" : "round",
 "comment" : "\nRound Activation Operator.\n\n$out = [x]$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Round operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Round operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215
},{
 "type" : "norm",
 "comment" : "\n       \"Input shape: $(N, C, H, W)$\n        Scale shape: $(C, 1)$\n        Output shape: $(N, C, H, W)$\n        Where\n        forward\n          $$\n            [\\frac {x_{1}}{\\sqrt{\\sum{x_{i}^{2}}}} \\frac {x_{2}}{\\sqrt{\\sum{x_{i}^{2}}}} \\frac {x_{3}}{\\sqrt{\\sum{x_{i}^{2}}}} \\cdot  \\cdot  \\cdot \\frac {x_{n}}{\\sqrt{\\sum{x_{i}^{2}}}}]\n          $$\n        backward\n          $$\n            \\frac{\\frac{\\mathrm{d}L }{\\mathrm{d}y_{1}} - \\frac {x_{1}\\sum {\\frac{\\mathrm{d} L}{\\mathrm{d} y_{j}}}x_{j}}{\\sum x_{j}^{2}} }{\\sqrt{\\sum{x_{j}^{2}}}}\n          $$\n        ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of norm operator. The format of input tensor is NCHW. Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Scale",
   "comment" : "(Tensor) The input tensor of norm operator. The format of input tensor is C * 1.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of norm operator.N * M.M = C * H * W",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1e-10) Constant for numerical stability.",
   "generated" : 0
 } ] 
},{
 "type" : "modified_huber_loss",
 "comment" : "\nModified Huber Loss Operator.\n\nThis operator is used in binary classification problem. The shape of\ninput X and target Y are both [N, 1] and so is the shape of the output loss.\nSince target Y is not differentiable, calculating gradient for Y is illegal.\nThe formula of modified huber loss is:\n\n$$\nL(y, f(x)) = \n\\begin{cases}\n(\\max(0, 1 - yf(x)))^2,  \\text{if} \\  yf(x) >= -1    \\\\\n             -4yf(x),    \\quad \\text{otherwise}\n\\end{cases}\n$$\n\nMake sure the values of target label Y are in {0, 1} here. This operator will\nscale values of Y to {-1, +1} when computing losses and gradients.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The input tensor of modified huber loss op. X is 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "The target labels of modified huber loss op. The shape of Y is the same as X. Values of Y must be 0 or 1.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "IntermediateVal",
   "comment" : "Variable to save intermediate result which will be reused in backward processing.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Out",
   "comment" : "Classification loss for X.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
2216 2217
},{
 "type" : "elementwise_sub",
2218
 "comment" : "\nLimited Elementwise Sub Operator.\n\nThe equation is:\n\n$$Out = X - Y$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
2219 2220 2221
 "inputs" : [ 
 { 
   "name" : "X",
2222
   "comment" : "(Tensor), The first input tensor of elementwise op.",
2223 2224 2225 2226
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
2227
   "comment" : "(Tensor), The second input tensor of elementwise op.",
2228 2229 2230 2231 2232 2233
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
2234
   "comment" : "The output of elementwise op.",
2235 2236 2237 2238 2239 2240 2241
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
2242
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
2243 2244
   "generated" : 0
 } ] 
2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269
},{
 "type" : "logical_or",
 "comment" : "logical_or Operator\n\nIt operates element-wise on X and Y, and returns the Out. X, Y and Out are N-dim boolean tensors.\nEach element of Out is calculated by $$Out = X || Y$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) Left hand operand of logical_or operator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(LoDTensor) Right hand operand of logical_or operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is $$Out = X || Y$$",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "conv2d_transpose",
2270
 "comment" : "\nConvolution2D Transpose Operator.\n\nThe convolution transpose operation calculates the output based on the input, filter\nand dilations, strides, paddings, groups parameters. The size of each dimension of the\nparameters is checked in the infer-shape.\nInput(Input) and output(Output) are in NCHW format. Where N is batchsize, C is the\nnumber of channels, H is the height of the feature, and W is the width of the feature.\nFilter(Input) is in MCHW format. Where M is the number of input feature channels,\nC is the number of output feature channels, H is the height of the filter,\nand W is the width of the filter.\nParameters(strides, paddings) are two elements. These two elements represent height\nand width, respectively.\nThe input(X) size and output(Out) size may be different.\n\nExample:\n  Input:\n       Input shape: $(N, C_{in}, H_{in}, W_{in})$\n       Filter shape: $(C_{in}, C_{out}, H_f, W_f)$\n  Output:\n       Output shape: $(N, C_{out}, H_{out}, W_{out})$\n  Where\n  $$\n       H_{out} = (H_{in} - 1) * strides[0] - 2 * paddings[0] + dilations[0] * (H_f - 1) + 1 \\\\\n       W_{out} = (W_{in} - 1) * strides[1] - 2 * paddings[1] + dilations[1] * (W_f - 1) + 1\n  $$\n",
2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) The input tensor of convolution transpose operator. The format of input tensor is NCHW. Where N is batch size, C is the number of input channels, H is the height of the feature, and W is the width of the feature.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Filter",
   "comment" : "(Tensor) The filter tensor of convolution transpose operator. The format of the filter tensor is MCHW, where M is the number of input feature channels, C is the number of output feature channels,H is the height of the filter, and W is the width of the filter. We enforce groups number == 1 in the convolution transpose scenario.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Output",
   "comment" : "(Tensor) The output tensor of convolution transpose operator. The format of output tensor is also NCHW.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "dilations",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the dilations(h_dilation, w_dilation) of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the strides(h_stride, w_stride) of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int> default:{0, 0}), the paddings(h_pad, w_pad) of convolution transpose operator.",
   "generated" : 0
 }, { 
   "name" : "use_cudnn",
   "type" : "bool",
   "comment" : "(bool, default false) Only used in cudnn kernel, need install cudnn",
   "generated" : 0
 }, { 
   "name" : "data_format",
   "type" : "string",
   "comment" : "(string, default NCHW) Only used in An optional string from: \"NHWC\", \"NCHW\". Defaults to \"NHWC\". Specify the data format of the output data, the input will be transformed automatically. ",
   "generated" : 0
 }, { 
   "name" : "workspace_size_MB",
   "type" : "int",
   "comment" : "Used in cudnn kernel only. workspace size for cudnn, in MB, workspace is a section of GPU memory which will be allocated/freed each time the operator runs, larger workspace size can increase performance but also requires better hardward. This size should be carefully setted.",
   "generated" : 0
 } ] 
},{
 "type" : "elementwise_max",
 "comment" : "\nLimited Elementwise Max Operator.\n\nThe equation is:\n\n$$Out = max(X, Y)$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor), The first input tensor of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(Tensor), The second input tensor of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of elementwise op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
   "generated" : 0
 } ] 
2351
},{
2352 2353
 "type" : "rnn_memory_helper",
 "comment" : "",
2354 2355
 "inputs" : [ 
 { 
2356 2357
   "name" : "X",
   "comment" : "",
2358 2359 2360 2361 2362 2363
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
2364
   "comment" : "",
2365 2366 2367
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
2368
 "attrs" : [ 
2369
 { 
2370 2371 2372 2373 2374
   "name" : "dtype",
   "type" : "int",
   "comment" : "(int, default 5 (FP32)) Output data type",
   "generated" : 0
 } ] 
2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418
},{
 "type" : "smooth_l1_loss",
 "comment" : "\nSmooth L1 Loss Operator.\n\nThis operator computes the smooth l1 loss for X and Y.\nThe operator takes the first dimension of X and Y as batch size.\nFor each instance, it computes the smooth l1 loss element by element first\nand then sums all the losses. So the shape of Out is [batch_size, 1].\n\nThe equation is:\n$$\nOut_{\\sigma}(X, Y)_i = \\begin{cases}\n0.5 * (\\sigma * (X_i - Y_i)) ^ 2\n\\quad |X_i - Y_i| \\lt \\frac{1} {{\\sigma} ^ 2} \\\\\n\\frac{|X_i - Y_i| - 0.5}{{\\sigma}^2},\n\\quad otherwise\n\\end{cases}\n$$\n\nIn the above equation, $Out_{\\sigma}(X, Y)_i$, $X_i$ and $Y_i$ represent the ith\nelement of Out, X and Y.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor, default Tensor<float>) A tensor with rank at least 2. The input value of smooth l1 loss op with shape [batch_size, dim1, ..., dimN].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(Tensor, default Tensor<float>) A tensor with rank at least 2. The target value of smooth l1 loss op with same shape as X.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "InsideWeight",
   "comment" : "(Tensor, default Tensor<float>) A tensor with rank at least 2. This input is optional and should have same shape with X. If provided, the result of (X - Y) will be multiplied by this tensor element by element.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "OutsideWeight",
   "comment" : "(Tensor, default Tensor<float>) A tensor with rank at least 2. This input is optional and should have same shape with X. If provided, the out smooth l1 loss will be multiplied by this tensor element by element.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Diff",
   "comment" : "Intermediate variable to cache InsideWeight * (X - Y).",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Out",
   "comment" : "(Tensor, default Tensor<float>) A tensor with rank be 2. The output smooth l1 loss with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "sigma",
   "type" : "float",
   "comment" : "Hyper parameter of smooth l1 loss op.A float scalar with default value 3.0.",
   "generated" : 0
 } ] 
2419
},{
2420 2421
 "type" : "lstm_unit",
 "comment" : "\nLstm Unit Operator\n\nEquation:\n\n$$\ni, f, o, j = split(X) \\\\\nC = C_{prev} * sigm(f + forget\\_bias) + sigm(i) * tanh(j) \\\\\nH = C * sigm(o)\n$$\n\n",
2422 2423 2424
 "inputs" : [ 
 { 
   "name" : "X",
2425 2426 2427 2428 2429 2430
   "comment" : "Lstm unit only applies non-linear activations, please make surethat linear tranformation has already been applied to `X`. Linear tranformation can be applied by adding a `fc` layer",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "C_prev",
   "comment" : "The cell state tensor of last time-step in the Lstm Unit operator.",
2431 2432 2433 2434 2435
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
2436 2437 2438 2439 2440 2441 2442
   "name" : "C",
   "comment" : "The cell tensor of Lstm Unit operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "H",
   "comment" : "The hidden state tensor of Lstm Unit operator.",
2443 2444 2445 2446 2447
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
2448
   "name" : "forget_bias",
2449
   "type" : "float",
2450
   "comment" : "(float, default 0.0) The forget bias of Lstm Unit.",
2451 2452 2453
   "generated" : 0
 } ] 
},{
2454 2455
 "type" : "squared_l2_norm",
 "comment" : "\nSquaredL2Norm Operator.\n\nComputes the squared L2 norm of a tensor.\n\n$$Out = \\sum_{i} X_{i}^2$$\n\n",
2456 2457
 "inputs" : [ 
 { 
2458
   "name" : "X",
2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472
   "comment" : "(Tensor) The input of squared_l2_norm op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Scalar) The output of squared_l2_norm op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "sequence_expand",
2473
 "comment" : "\nSequence Expand Operator.\n\nThis operator expands input(X) according to LOD of input(Y).\nFollowing are cases to better explain how this works:\nCase 1:\n\nGiven a 2-level LoDTensor input(X)\n    X.lod = [[0,       2, 3],\n             [0, 1,    3, 4]]\n    X.data = [a, b, c, d]\n    X.dims = [4, 1]\nand input(Y)\n    Y.lod = [[0,    2,    4],\n             [0, 3, 6, 7, 8]]\nwith condition len(Y.lod[-1]) -1 == X.dims[0]\nthen we get 2-level LoDTensor\n    Out.lod = [[0,                2,    4],\n               [0,       3,       6, 7, 8]]\n    Out.data = [a, a, a, b, b, b, c, d]\n    Out.dims = [8, 1]\n\nCase 2:\n\nGiven a common Tensor input(X)\n    X.data = [a, b, c]\n    X.dims = [3, 1]\nand input(Y)\n    Y.lod = [[0, 2, 3, 6]]\nwith condition len(Y.lod[-1]) -1 == X.dims[0]\nthen we get 1-level LoDTensor\n    Out.lod = [[0,    2, 3,      6]]\n    Out.data = [a, a, b, c, c, c]\n    Out.dims = [6, 1]\n\nCase 3:\n\nGiven a common Tensor input(X)\n    X.data = [[a, b], [c, d], [e, f]]\n    X.dims = [3, 2]\nand input(Y)\n    Y.lod = [[0, 2, 3, 6]]\nwith condition len(Y.lod[-1]) -1 == X.dims[0]\nthen we get 1-level LoDTensor\n    Out.lod = [[0,           2,     3,                     6]]\n    Out.data = [[a,b], [a,b] [c,d], [e, f], [e, f], [e, f]]\n    Out.dims = [6, 2]\n\nCase 4:\n\nGiven 2-level a LoDTensor input(X)\n    X.lod = [[0,       2, 3],\n             [0, 1,    3, 4]]\n    X.data = [a, b, c, d]\n    X.dims = [4, 1]\nand input(Y)\n    Y.lod = [[0,    2,    4],\n             [0, 3, 6, 6, 8]]\nwith condition len(Y.lod[-1]) -1 == X.dims[0]\nthen we get 2-level LoDTensor\n    Out.lod = [[0,                2,    4],\n               [0,       3,       6, 6, 8]]\n    Out.data = [a, a, a, b, b, b, d, d]\n    Out.dims = [8, 1]\n\n\n",
2474 2475 2476 2477
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor or LoDTensor) The input(X) of this operator can be a LoDTensor or a base Tensor.",
2478 2479 2480
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
2481 2482
   "name" : "Y",
   "comment" : "(LoDTensor)The reference input(Y) of sequence_expand op.It must be a LoDTensor with k-level(k>0).The input(X) will be expanded according to LOD of input(Y).The element numbers of last level in input(Y) must be equal to dims[0] of input(X).",
2483 2484 2485 2486 2487
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500
   "name" : "Out",
   "comment" : "(LodTensor)The output of sequence_expand op.The lod of output will be as same as input(Y)'s lod.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "momentum",
 "comment" : "\nMomentum Optimizer.\n\nThis optimizer has a flag for Nestrov Momentum.\nThe update equations are as follows:\n\n$$\nvelocity = mu * velocity + gradient \\\\\nif (use\\_nesterov):   \\\\\n  param = param - gradient * learning\\_rate + mu * velocity * learning\\_rate \\\\\nelse:   \\\\\n  param = param - learning\\_rate * velocity. \\\\\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor, default Tensor<float>) Input parameter that has to be updated",
2501 2502 2503
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527
   "name" : "Grad",
   "comment" : "(Tensor, default Tensor<float>) Input gradient of the parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Velocity",
   "comment" : "(Tensor, default Tensor<float>) Input velocity (corresponding to the parameter) that has to be updated",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor, default Tensor<float>) Input learning rate",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) This output is updated parameter. It shared memory with Input(Param).",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "VelocityOut",
   "comment" : "(Tensor) This output is updated velocity. It shared memory with Input(Velocity).",
2528 2529 2530 2531 2532
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
2533
   "name" : "mu",
2534
   "type" : "float",
2535 2536 2537 2538 2539 2540
   "comment" : "(float) Momentum coefficient",
   "generated" : 0
 }, { 
   "name" : "use_nesterov",
   "type" : "bool",
   "comment" : "(bool, default false) Use Nesterov Momentum",
2541 2542 2543
   "generated" : 0
 } ] 
},{
2544 2545 2546
 "type" : "uniform_random",
 "comment" : "\nUniform random operator.\n\nThis operator initializes a tensor with random values sampled from a \nuniform distribution.\n\n",
 "inputs" : [  ], 
2547 2548 2549
 "outputs" : [ 
 { 
   "name" : "Out",
2550
   "comment" : "(Tensor) The output tensor of uniform random op",
2551 2552 2553 2554 2555
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
2556 2557 2558 2559 2560 2561
   "name" : "shape",
   "type" : "int array",
   "comment" : "(vector<int>) The shape of the output tensor",
   "generated" : 0
 }, { 
   "name" : "min",
2562
   "type" : "float",
2563
   "comment" : "(float, default -1.0) Minimum value of uniform random",
2564 2565
   "generated" : 0
 }, { 
2566 2567 2568
   "name" : "max",
   "type" : "float",
   "comment" : "(float, default 1.0) Maximun value of uniform random",
2569 2570 2571 2572
   "generated" : 0
 }, { 
   "name" : "seed",
   "type" : "int",
2573 2574 2575 2576 2577 2578
   "comment" : "(int, default 0) Random seed used for generating samples. 0 means use a seed generated by the system.",
   "generated" : 0
 }, { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "(int, default 5(FP32)) Output tensor data type",
2579 2580 2581
   "generated" : 0
 } ] 
},{
2582 2583
 "type" : "pad",
 "comment" : "\nPad Operator.\n\nPad input into output, as specified by paddings and pad_value. \nThe input should be a k-D tensor(k > 0 and k < 7). As an example:\n\nGiven:\n\nX = [[1, 2],\n     [3, 4]],\n\npaddings = [0, 1, 1, 2],\n\nand\n\npad_value = 0,\n\nwe have:\n\nOut = [[0, 1, 2, 0, 0]\n       [0, 3, 4, 0, 0]\n       [0, 0, 0, 0, 0]]\n\n",
2584 2585 2586
 "inputs" : [ 
 { 
   "name" : "X",
2587
   "comment" : "The input of pad op. The input should be a k-D tensor(k > 0 and k < 7)",
2588 2589
   "duplicable" : 0,
   "intermediate" : 0
2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of pad op. A tensor with the same shape as X.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int>) A list<int> to describe the padding rules for each dimension. For 2-D image tensor, paddings=[0, 1, 2, 3] means padding 0 row to top, 1 row to bottom, 2 columns to left and 3 columns to right. Size of paddings should be equal to 2 * dimension size of the input tensor.",
   "generated" : 0
 }, { 
   "name" : "pad_value",
   "type" : "float",
   "comment" : "(float, default 0.0) The value to fill the padded areas.",
   "generated" : 0
 } ] 
},{
 "type" : "reorder_lod_tensor_by_rank",
2612
 "comment" : "ReorderLoDTensorByRankTable operator.\n\nInput(X) is a batch of sequences. Input(RankTable) stores new orders of the\ninput sequence batch. The reorder_lod_tensor_by_rank operator reorders the\nInput(X) according to the information provided by Input(RankTable).\n\nFor example:\n\nIf the indices stored in the Input(RankTable) are [3, 0, 2, 1], the\nInput(X) will be reordered that the fourth sequence in Input(X) will become the\nfirst one, and then followed by the original first, third, and the second one.\n\nThis is:\nX = [Seq0, Seq1, Seq2, Seq3]. The indices in RankTable are [3, 0, 2, 1].\nOut =  [Seq3, Seq0, Seq2, Seq1] with a new LoD information.\n\nIf the LoD information of Input(X) is empty, this means Input(X) is not sequence\ndata. This is also identical to a batch of sequences where each sequence has a\nfixed length 1. In this case, the reorder_lod_tensor_by_rank operator reorders\neach slice of Input(X) along the first axis according to Input(RankTable).\n\nThis is:\nX = [Slice0, Slice1, Slice2, Slice3] and its LoD information is empty. The\nindices in RankTable are [3, 0, 2, 1].\nOut = [Slice3, Slice0, Slice2, Slice1] with no LoD information is appended.\n\nNOTE: This operator sorts Input(X) according to a given LoDRankTable which does\nnot need to be calculated according to Input(X). It can be calculated according\nto another different sequence, and then this operator sorts Input(X) according\nto the given LoDRankTable.\n\n",
2613 2614 2615
 "inputs" : [ 
 { 
   "name" : "X",
2616
   "comment" : "(LoDTensor), the input lod tensor to be reordered according to Input(RankTable).",
2617 2618 2619 2620
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "RankTable",
2621
   "comment" : "(LoDRankTable), the rank table according to which Input(X) is reordered.",
2622 2623 2624 2625 2626 2627
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
2628
   "comment" : "(LoDTensor), the reordered lod tensor.",
2629 2630 2631 2632
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
2633 2634
},{
 "type" : "split_selected_rows",
2635
 "comment" : "\nSplit a SelectedRows with a specified rows section.\nheight_sections is only needed when need to split the dims of the original tensor.\n\nExample:\n  Input:\n    X.rows = {7, 5}\n    X.height = 12\n  Attr:\n    height_sections = {4, 8}\n  Out:\n    out0.rows = {}\n    out0.height = 4\n\n    out1.rows = {5, 7}\n    out2.height = 8\n\n",
2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The input SelectedRows.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The outputs of input SelectedRows.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "height_sections",
   "type" : "int array",
   "comment" : "Height for each output SelectedRows.",
   "generated" : 0
 } ] 
},{
 "type" : "adam",
 "comment" : "\nAdam Optimizer.\n\nThis implements the Adam optimizer from Section 2 of the Adam\npaper : https://arxiv.org/abs/1412.6980.\nAdam is a first-order gradient-based optimization method based on\nadaptive estimates of lower-order moments.\n\nAdam updates:\n\n$$\nmoment\\_1\\_out = \\beta_1 * moment\\_1 + (1 - \\beta_1) * grad \\\\\nmoment\\_2_\\out = \\beta_2 * moment\\_2 + (1 - \\beta_2) * grad * grad \\\\\nlearning\\_rate = learning\\_rate *\n                  \\frac{\\sqrt{1 - \\beta_{2\\_pow}}}{1 - \\beta_{1\\_pow}} \\\\\nparam\\_out = param - learning\\_rate * \\frac{moment\\_1}{\\sqrt{moment\\_2} + \\epsilon}\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor) Learning rate",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment1",
   "comment" : "(Tensor) Input first moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment2",
   "comment" : "(Tensor) Input second moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Beta1Pow",
   "comment" : "(Tensor) Input beta1 power accumulator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Beta2Pow",
   "comment" : "(Tensor) Input beta2 power accumulator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment1Out",
   "comment" : "(Tensor) Output first moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment2Out",
   "comment" : "(Tensor) Output second moment",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "beta1",
   "type" : "float",
   "comment" : "(float, default 0.9) Exponential decay rate for the first moment estimates.",
   "generated" : 0
 }, { 
   "name" : "beta2",
   "type" : "float",
   "comment" : "(float, default 0.999) exponential decay rate for the second moment estimates.",
   "generated" : 0
 }, { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1.0e-8) Constant for numerical stability",
   "generated" : 0
 } ] 
},{
 "type" : "increment",
 "comment" : "\nIncrement Operator.\n\nThe equation is: \n$$Out = X + step$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of increment operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of increment operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "step",
   "type" : "float",
   "comment" : "(float, default 1.0) The step size by which the input tensor will be incremented.",
   "generated" : 0
 } ] 
2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830
},{
 "type" : "gru_unit",
 "comment" : "\nGRUUnit Operator implements partial calculations of the GRU unit as following:\n\n$$\nupdate \\ gate: u_t = actGate(xu_t + W_u * h_{t-1} + b_u) \\\\\nreset \\ gate: r_t = actGate(xr_t + W_r * h_{t-1} + b_r)  \\\\\noutput \\ candidate: {h}_t = actNode(xc_t + W_c * dot(r_t, h_{t-1}) + b_c) \\\\\noutput: h_t = dot((1 - u_t), h_{t-1}) + dot(u_t, {h}_t)\n$$\n\nwhich is same as one time step of GRU Operator.\n\n@note To implement the complete GRU unit, fully-connected operator must be \nused before to feed xu, xr and xc as the Input of GRUUnit operator.\n\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) Matrix with shape [batch_size, frame_size * 3] for the input.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "HiddenPrev",
   "comment" : "(Tensor) Matrix with shape [batch_size, frame_size] for the states of previous time step.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(Tensor) Weight matrix with shape [frame_size, frame_size * 3]. The elements continuous in memory can be divided into two parts. The first part are weights of the update gate and reset gate with shape [frame_size, frame_size * 2], and the second part are weights of output candidate with shape [frame_size, frame_size].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor) Bias vector with shape [1, frame_size * 3] concatenating bias of the update gate, reset gate and output candidate.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Gate",
   "comment" : "(Tensor) Matrix with shape [batch_size, frame_size * 3] for the output of update gate, reset gate and output candidate.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "ResetHiddenPrev",
   "comment" : "(Tensor) Matrix with shape [batch_size, frame_size] for the reseted hidden state of previous time step.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Hidden",
   "comment" : "(Tensor) The GRU hidden state of the current time step with shape [batch_size, frame_size].",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "activation",
   "type" : "int",
   "comment" : "(enum int, default tanh) The activation type used for output candidate {h}_t.",
   "generated" : 0
 }, { 
   "name" : "gate_activation",
   "type" : "int",
   "comment" : "(enum int, default sigmoid) The activation type used in update gate and reset gate.",
   "generated" : 0
 } ] 
},{
 "type" : "less_than",
 "comment" : "less_than Operator\n\nIt operates element-wise on X and Y, and returns the Out. Each of them is a\nN-dim tensor. X and Y could be any type.  The each element of the Out tensor is\ncalculated by Out = X < Y\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) the left hand operand of less_than operator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(LoDTensor) the right hand operand of less_than operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is Out = X < Y",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
2831 2832 2833 2834 2835 2836 2837
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
   "generated" : 0
 } ] 
2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895
},{
 "type" : "sequence_pool",
 "comment" : "\nSequence Pool Operator.\n\nThe SequencePoolOp pools features of all time-steps of each instance.\nIt supports six pooling types:\n1. AVERAGE: $$Out[i] = \\frac{\\sum_i X_i}{N}$$\n2. SUM:     $$Out[i] = \\sum_jX_{ij}$$\n3. SQRT:    $$Out[i] = \\frac{\\sum_jX_{ij}}{\\sqrt{len(X_i)}}$$\n4. LAST:    Out[i] = last instance in i-th sequence X[i]\n5. FIRST:   Out[i] = first instance in i-th sequence X[i]\n6. MAX:     $$Out[i] = max(X_i)$$\n\nThe following example explains how this works:\nFor a mini-batch of 3 variable-length sentences,\ncontaining 2, 3, and 2 time-steps:\n\nAssume X is a [7,M,N] LoDTensor, and X->lod()[0] = [0, 2, 5, 7], 7=2+3+2.\nBesides, for the sake of simplicity, we assume M=1 and N=1,\nand the value of X = [[1, 3], [2, 4, 6], [5, 1]].\n\nThus, Out is a [3,1,1] Tensor without LoD infomation.\nAnd for different pooltype, the value of Out is as follows:\n\n- AVERAGE: [2, 4, 3], where 2=(1+3)/2, 4=(2+4+6)/3, 3=(5+1)/2\n- SUM: [4, 12, 6], where 4=1+3, 12=2+4+6, 6=5+1\n- SQRT: [2.82, 6.93, 4.24], where 2.82=(1+3)/sqrt(2),\n           6.93=(2+4+6)/sqrt(3), 4.24=(5+1)/sqrt(2)\n- MAX: [3, 6, 5], where 3=max(1,3), 6=max(2,4,6), 5=max(5,1)\n- LAST: [3, 6, 1], where 3=last(1,3), 6=last(2,4,6), 1=last(5,1)\n- FIRST: [1, 2, 5], where 1=first(1,3), 2=first(2,4,6), 5=first(5,1)\n\n    ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) The variable-length input of SequencePoolOp",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output of SequencePoolOp does not contain LoD infomation.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MaxIndex",
   "comment" : "(Tensor<int>) This tensor is used for the sequence max-pooling to record the max indexes.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [ 
 { 
   "name" : "pooltype",
   "type" : "string",
   "comment" : "(string, default 'AVERAGE') the pooling pooltype of SequencePoolOp.",
   "generated" : 0
 } ] 
},{
 "type" : "spp",
 "comment" : "\n        \"With spatial pyramid pooling, the input image can\n        be of any sizes. This not only allows arbitrary aspect\n        ratios, but also allows arbitrary scales. We can resize\n        the input image to any scale (e.g., min(w, h)=180, 224,\n        ...) and apply the same deep network. When the\n        input image is at different scales, the network (with\n        the same filter sizes) will extract features at different\n        scales. The scales play important roles in traditional\n        methods.\n        Input shape: $(N, C_{in}, H_{in}, W_{in})$\n        Output shape: $(H_{out}, W_{out})$\n        Where\n          $$\n            H_{out} = N \\\\\n            W_{out} = (((4^pyramid_height) - 1) / (4 - 1))$ * C_{in}\n          $$\n        paper https://arxiv.org/pdf/1406.4729v4.pdf\n        ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of spp operator. The format of input tensor is NCHW. Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of spp operator.N * M.M = C * H * W",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "pyramid_height",
   "type" : "int",
   "comment" : "(int), multi level pooling",
   "generated" : 0
 }, { 
   "name" : "pooling_type",
   "type" : "string",
   "comment" : "(string), pooling type, can be \"max\" for max-pooling and \"avg\" for average-pooling.",
   "generated" : 0
 } ] 
2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914
},{
 "type" : "sign",
 "comment" : "\nSign operator\n\n$$Out = X.sign()$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) Input tensor of sign operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) Output tensor of sign operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
2915 2916
 "type" : "reduce_sum",
 "comment" : "\nReduceSum Operator.\n\nThis operator computes the sum of input tensor along the given dimension. \nThe result tensor has 1 fewer dimension than the input unless keep_dim is true.\nIf reduce_all is true, just reduce along all dimensions and output a scalar.\n\n",
2917 2918 2919
 "inputs" : [ 
 { 
   "name" : "X",
2920
   "comment" : "(Tensor) The input tensor. Tensors with rank at most 6 are supported.",
2921 2922
   "duplicable" : 0,
   "intermediate" : 0
2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The result tensor.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "dim",
   "type" : "int",
   "comment" : "(int, default 0) The dimension to reduce. Must be in the range [-rank(input), rank(input)). If `dim < 0`, the dim to reduce is `rank + dim`. Note that reducing on the first dim will make the LoD info lost.",
   "generated" : 0
2937
 }, { 
2938 2939 2940 2941 2942 2943 2944 2945 2946 2947
   "name" : "keep_dim",
   "type" : "bool",
   "comment" : "(bool, default false) If true, retain the reduced dimension with length 1.",
   "generated" : 0
 }, { 
   "name" : "reduce_all",
   "type" : "bool",
   "comment" : "(bool, default false) If true, output a scalar reduced along all dimensions.",
   "generated" : 0
 } ] 
2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981
},{
 "type" : "im2sequence",
 "comment" : "\nThis op uses kernels to scan images and converts these images to sequences.\nAfter expanding, The number of time steps are output_height * output_width\nand the dimension of each time step is kernel_height * kernel_width * channels,\nin which:\n\noutput_height =\n    1 + (padding_height + padding_down + img_height - kernel_height + stride_height - 1) /\n            stride_height;\noutput_width =\n    1 + (padding_left + padding+right + img_width - kernel_width + stride_width - 1) /\n            stride_width;\n\nThis op can be used after convolution neural network, and before recurrent neural network.\n\nGiven:\n\nx = [[[[ 6.  2.  1.]\n       [ 8.  3.  5.]\n       [ 0.  2.  6.]]\n\n      [[ 2.  4.  4.]\n       [ 6.  3.  0.]\n       [ 6.  4.  7.]]]\n\n     [[[ 6.  7.  1.]\n       [ 5.  7.  9.]\n       [ 2.  4.  8.]]\n\n      [[ 1.  2.  1.]\n       [ 1.  3.  5.]\n       [ 9.  0.  8.]]]]\nx.dims = {2, 2, 3, 3}\n\nAnd:\n\nkernels = [2, 2]\nstrides = [1, 1]\npaddings = [0, 0, 0, 0]\n\nThen:\n\noutput.data = [[ 6.  2.  8.  3.  2.  4.  6.  3.]\n               [ 2.  1.  3.  5.  4.  4.  3.  0.]\n               [ 8.  3.  0.  2.  6.  3.  6.  4.]\n               [ 3.  5.  2.  6.  3.  0.  4.  7.]\n               [ 6.  7.  5.  7.  1.  2.  1.  3.]\n               [ 7.  1.  7.  9.  2.  1.  3.  5.]\n               [ 5.  7.  2.  4.  1.  3.  9.  0.]\n               [ 7.  9.  4.  8.  3.  5.  0.  8.]]\noutput.dims = {8, 9}\noutput.lod = [[0, 4, 8]]\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor has NCHW format.N: batch sizeC: channelsH: heightW: width",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LodTensor) The output data of im2sequence op,",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "kernels",
   "type" : "int array",
   "comment" : "(vector<int>), the kernels(kernel_height, kernel_width)",
   "generated" : 0
 }, { 
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector<int> default:{1, 1}), the strides(h_stride, w_stride)",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector<int> default:{0, 0, 0, 0}), the paddings(up_pad, left_pad, down_pad, right_pad)",
   "generated" : 0
 } ] 
2982 2983 2984 2985 2986 2987 2988
},{
 "type" : "stanh",
 "comment" : "\nSTanh Activation Operator.\n\n$$out = b * \\frac{e^{a * x} - e^{-a * x}}{e^{a * x} + e^{-a * x}}$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of STanh operator",
2989 2990 2991 2992 2993 2994
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
2995
   "comment" : "Output of STanh operator",
2996 2997
   "duplicable" : 0,
   "intermediate" : 0
2998 2999 3000 3001 3002 3003 3004
 } ], 
 "attrs" : [ 
 { 
   "name" : "scale_a",
   "type" : "float",
   "comment" : "The scale parameter of a for the input",
   "generated" : 0
3005
 }, { 
3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017
   "name" : "scale_b",
   "type" : "float",
   "comment" : "The scale parameter of b for the input",
   "generated" : 0
 } ] 
},{
 "type" : "adamax",
 "comment" : "\nAdamax Optimizer.\n\nWe implement the Adamax optimizer from Section 7 of the Adam\npaper: https://arxiv.org/abs/1412.6980. Adamax is a variant of the\nAdam algorithm based on the infinity norm.\n\nAdamax updates:\n\n$$\nmoment\\_out = \\beta_1 * moment + (1 - \\beta_1) * grad \\\\\ninf\\_norm\\_out = max(\\beta_2 * inf\\_norm + \\epsilon, |grad|) \\\\\nlearning\\_rate = \\frac{learning\\_rate}{1 - \\beta_{1\\_pow}} \\\\\nparam\\_out = param - learning\\_rate * \\frac{moment\\_out}{inf\\_norm\\_out}\n$$\n\nThe original paper does not have an epsilon attribute.\nHowever, it is added here for numerical stability to prevent the\ndivision by 0 error.\n\n",
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
3018
   "duplicable" : 0,
3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor) Learning rate",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment",
   "comment" : "(Tensor) First moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "InfNorm",
   "comment" : "(Tensor) Input exponentially weighted infinity norm",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Beta1Pow",
   "comment" : "(Tensor) Input beta1 power accumulator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MomentOut",
   "comment" : "(Tensor) Output first moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "InfNormOut",
   "comment" : "(Tensor) Output exponentially weighted infinity norm",
   "duplicable" : 0,
   "intermediate" : 0
3062 3063 3064
 } ], 
 "attrs" : [ 
 { 
3065
   "name" : "beta1",
3066
   "type" : "float",
3067
   "comment" : "(float, default 0.9) Exponential decay rate for the 1st moment estimates.",
3068 3069
   "generated" : 0
 }, { 
3070 3071 3072
   "name" : "beta2",
   "type" : "float",
   "comment" : "(float, default 0.999) exponential decay rate for the weighted infinity norm estimates.",
3073 3074
   "generated" : 0
 }, { 
3075 3076 3077
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1.0e-8) Constant for numerical stability",
3078 3079 3080
   "generated" : 0
 } ] 
},{
3081 3082
 "type" : "tanh_shrink",
 "comment" : "\nTanhShrink Activation Operator.\n\n$$out = x - \\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$$\n\n",
3083 3084
 "inputs" : [ 
 { 
3085
   "name" : "X",
3086
   "comment" : "Input of TanhShrink operator",
3087 3088 3089 3090 3091
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
3092
   "name" : "Out",
3093
   "comment" : "Output of TanhShrink operator",
3094 3095 3096
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
3097
 "attrs" : [  ] 
3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208
},{
 "type" : "positive_negative_pair",
 "comment" : "\nPositiveNegativePairOp can be used to evaluate Learning To Rank(LTR) model's\nperformance.\n\nWithin some context, e.g. the \"query\", a LTR model generates scores for a list\nof items, which gives a partial order of the items. PositiveNegativePairOp\ntakes a list of reference rank order (Input(\"Label\")) and the model generated\nscores (Input(Score)) as inputs and counts the pairs that ranked correctly\nand incorrectly.\n",
 "inputs" : [ 
 { 
   "name" : "Score",
   "comment" : "(Tensor, float) Model Score on an item (with respect to QueryID). It's a 2-D tensor with shape [batch_size, depth], where the column specified by the attribute \"column\" is used as item score.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(Tensor, float) Label of an item (with repsect to QueryId). It's a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "QueryID",
   "comment" : "(Tensor, int64) Query ID that indicates the context. Its shape should be the same as Label.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "AccumulatePositivePair",
   "comment" : "(float) Optional. The accumulated number of positive pairs over a stream of data. If provided, the output PositivePair will be initialized with this number rather than 0. it won't be modified in place.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "AccumulateNegativePair",
   "comment" : "(float) Optional. The accumulated number of negative pairs over a stream of data. If provided, the output NegativePair will be initialized with this number rather than 0. it won't be modified in place.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "AccumulateNeutralPair",
   "comment" : "(float) Optional. The accumulated number of neutral pairs over a stream of data. If provided, the output NeutralPair will be initialized with this number rather than 0. it won't be modified in place.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(float) Optional. Weight of current item. If specified, its shape should be the same as Label, and the meaning of the output changes from numbers of pairs to the total sum of pairs' weights. Weight of a pair of items is the average of their weights.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "PositivePair",
   "comment" : "(float) Number of positive pairs, i.e. the pairs of items that are ranked correctly.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "NegativePair",
   "comment" : "(float) Number of negative pairs, i.e. the pairs of items that are ranked incorrectly.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "NeutralPair",
   "comment" : "(float) Number of neutral pairs, i.e. the pairs of items that have the same score.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "column",
   "type" : "int",
   "comment" : "(int, default -1) The column position of Score used to rank items in descending order. It must be in the range of [-rank(Score), rank(Score)). If `dim < 0`, the dim to reduce is `rank + dim`. Noting that reducing on the first dim will make the LoD info lost.",
   "generated" : 0
 } ] 
},{
 "type" : "one_hot",
 "comment" : "\nOne Hot Operator. This operator creates the one-hot representations for input\nindex values. The following example will help to explain the function of this\noperator:\n\nX is a LoDTensor:\n  X.lod = [[0, 1, 4]]\n  X.shape = [4, 1]\n  X.data = [[1], [1], [3], [0]]\n\nset depth = 4\n\nOut is a LoDTensor:\n  Out.lod = [[0, 1, 4]]\n  Out.shape = [4, 4]\n  Out.data = [[0., 1., 0., 0.],\n              [0., 1., 0., 0.],\n              [0., 0., 0., 1.],\n              [1., 0., 0., 0.]]\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor, LoDTensor<int>) Input variable with rank at least 2. The last dimension of X should be 1. Each value of X is an index to indicate the position.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor, Tensor<float>) Output tensor with same rank as X. The tensor consists of one-hot representations of values in X.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "depth",
   "type" : "int",
   "comment" : "A positive integer to specify the length of one-hot vector.",
   "generated" : 0
 }, { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "An integer to specify the data type of one-hot vector. The default value is FP32.",
   "generated" : 0
 } ] 
},{
 "type" : "l1_norm",
 "comment" : "\nL1 Norm Operator.\n\nComputes the L1 norm of a tensor.\n\n$$Out = \\sum{|X|}$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input of l1_norm op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Scalar) The output of l1_norm op.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235
},{
 "type" : "roi_pool",
 "comment" : "\nROIPool operator\n\nROI Pooling for Faster-RCNN. The link below is a further introduction: \nhttps://stackoverflow.com/questions/43430056/what-is-roi-layer-in-fast-rcnn\n    ",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor), the input of ROIPoolOp. The format of input tensor is NCHW. Where N is batch size, C is the number of input channels, H is the height of the feature, and W is the width of the feature.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "ROIs",
   "comment" : "(Tensor), ROIs (Regions of Interest) to pool over. should be a 2-D tensor of shape (num_rois, 5)given as [[batch_id, x1, y1, x2, y2], …]. Where batch_id is the id of the data, (x1, y1) is the top left coordinates, and (x2, y2) is the bottom right coordinates.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor), The output of ROIPoolOp is a 4-D tensor with shape (num_rois, channels, pooled_h, pooled_w).",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Argmax",
   "comment" : "(Tensor), Argmaxes corresponding to indices in X used for gradient computation. Only output if arg “is_test” is false.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
3236 3237
 "attrs" : [ 
 { 
3238
   "name" : "spatial_scale",
3239
   "type" : "float",
3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250
   "comment" : "(float, default 1.0), Multiplicative spatial scale factor to translate ROI coords from their input scale to the scale used when pooling.",
   "generated" : 0
 }, { 
   "name" : "pooled_height",
   "type" : "int",
   "comment" : "(int, default 1), The pooled output height.",
   "generated" : 0
 }, { 
   "name" : "pooled_width",
   "type" : "int",
   "comment" : "(int, default 1), The pooled output width.",
3251 3252
   "generated" : 0
 } ] 
3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276
},{
 "type" : "pow",
 "comment" : "\nPow Activation Operator.\n\n$out = x^{factor}$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Pow operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Pow operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "factor",
   "type" : "float",
   "comment" : "The exponential factor of Pow",
   "generated" : 0
 } ] 
3277
},{
3278
 "type" : "unpool",
3279
 "comment" : "\nInput shape is: $(N, C_{in}, H_{in}, W_{in})$, Output shape is:\n$(N, C_{out}, H_{out}, W_{out})$, where\n$$\nH_{out} = (H_{in}−1) * strides[0] − 2 * paddings[0] + ksize[0] \\\\\nW_{out} = (W_{in}−1) * strides[1] − 2 * paddings[1] + ksize[1]\n$$\nPaper: http://www.matthewzeiler.com/wp-content/uploads/2017/07/iccv2011.pdf\n",
3280 3281 3282
 "inputs" : [ 
 { 
   "name" : "X",
3283
   "comment" : "(Tensor) The input tensor of unpool operator. The format of input tensor is NCHW. Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
3284 3285 3286
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
3287 3288
   "name" : "Indices",
   "comment" : "(Tensor) The input tensor of the indices given out by MaxPool2d. The format of input tensor is NCHW. Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
3289 3290 3291 3292 3293 3294
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3295
   "comment" : "(Tensor) The output tensor of unpool operator.The format of output tensor is also NCHW.Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
3296 3297 3298 3299 3300
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
3301 3302 3303
   "name" : "ksize",
   "type" : "int array",
   "comment" : "(vector), the unpooling window size(height, width) of unpooling operator.",
3304 3305
   "generated" : 0
 }, { 
3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318
   "name" : "strides",
   "type" : "int array",
   "comment" : "(vector, default:{1, 1}), strides (height, width) of unpooling operator.",
   "generated" : 0
 }, { 
   "name" : "paddings",
   "type" : "int array",
   "comment" : "(vector defalut:{0,0}), paddings (height, width) of unpooling operator.",
   "generated" : 0
 }, { 
   "name" : "unpooling_type",
   "type" : "string",
   "comment" : "(string), unpooling type, can be \"max\" for max-unpooling ",
3319 3320 3321
   "generated" : 0
 } ] 
},{
3322
 "type" : "transpose",
3323
 "comment" : "\nTranspose Operator.\n\nThe input tensor will be permuted according to the axes given.\nThe behavior of this operator is similar to how `numpy.transpose` works.\n\n- suppose the input `X` is a 2-D tensor:\n    $$\n    X = \\begin{pmatrix}\n    0 &1 &2 \\\\\n    3 &4 &5\n    \\end{pmatrix}$$\n\n    the given `axes` is: $[1, 0]$, and $Y$ = transpose($X$, axis)\n\n    then the output $Y$ is:\n\n    $$\n    Y = \\begin{pmatrix}\n         0 &3 \\\\\n         1 &4  \\\\\n         2 &5\n    \\end{pmatrix}$$\n\n- Given a input tensor with shape $(N, C, H, W)$ and the `axes` is \n$[0, 2, 3, 1]$, then shape of the output tensor will be: $(N, H, W, C)$.\n\n",
3324 3325 3326
 "inputs" : [ 
 { 
   "name" : "X",
3327
   "comment" : "(Tensor) The input tensor, tensors with rank up to 6 are supported.",
3328 3329 3330 3331 3332 3333
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3334
   "comment" : "(Tensor)The output tensor.",
3335 3336 3337 3338 3339
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
3340 3341
   "name" : "axis",
   "type" : "int array",
3342
   "comment" : "(vector<int>) A list of values, and the size of the list should be the same with the input tensor rank. This operator permutes the input tensor's axes according to the values given.",
3343 3344 3345
   "generated" : 0
 } ] 
},{
3346 3347
 "type" : "rnn_memory_helper_grad",
 "comment" : "",
3348 3349
 "inputs" : [ 
 { 
3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378
   "name" : "Out@GRAD",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "X",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Out",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "X@GRAD",
   "comment" : "",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "(int, default 5 (FP32)) Output data type",
   "generated" : 0
 } ] 
3379
},{
3380 3381
 "type" : "softplus",
 "comment" : "\nSoftplus Activation Operator.\n\n$out = \\ln(1 + e^{x})$\n\n",
3382 3383
 "inputs" : [ 
 { 
3384
   "name" : "X",
3385
   "comment" : "Input of Softplus operator",
3386 3387 3388 3389 3390
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
3391
   "name" : "Out",
3392
   "comment" : "Output of Softplus operator",
3393 3394 3395 3396
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3397
},{
3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422
 "type" : "get_places",
 "comment" : "\nReturns a list of places based on flags. The list will be used for parallel\nexecution.\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "vector of Place",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "device_count",
   "type" : "int",
   "comment" : "device count",
   "generated" : 0
 }, { 
   "name" : "device_type",
   "type" : "string",
   "comment" : "device type",
   "generated" : 0
 } ] 
},{
 "type" : "read_from_array",
 "comment" : "\nReadFromArray Operator.\n\nRead a LoDTensor from a LoDTensor Array.\n\nAssume $T$ is LoDTensor, $i$ is the subscript of the array, and $A$ is the array. The\nequation is\n\n$$T = A[i]$$\n\n",
3423 3424 3425
 "inputs" : [ 
 { 
   "name" : "X",
3426
   "comment" : "(TensorArray) the array will be read from.",
3427 3428 3429
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
3430 3431
   "name" : "I",
   "comment" : "(Tensor) the subscript index in tensor array. The number of element should be 1",
3432
   "duplicable" : 0,
3433
   "intermediate" : 0
3434
 } ], 
3435
 "outputs" : [ 
3436
 { 
3437
   "name" : "Out",
3438
   "comment" : "(LoDTensor) the tensor will be read from.",
3439 3440 3441 3442
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3443
},{
3444 3445
 "type" : "shrink_rnn_memory",
 "comment" : "\nThis operator is used to shrink output batch of memory defined in dynamic RNN.\n\nDynamic RNN is able to handle variable-length sequences, in which, sequences in\na mini-batch are sorted by their lengths first. After that, the longest sequence\nbecomes the first one in the sorted batch, followed by the second longest, the\nthird longest, and so on. Dynamic RNN then slices a batch input timestep by\ntimestep from the sorted input. Once any sequence in the input batch reaches its\nend, memory defined in dynamicRNN has to shrink its outputs to adapt to the input\nbatch size for the next time step.\n",
3446 3447 3448
 "inputs" : [ 
 { 
   "name" : "X",
3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459
   "comment" : "(LoDTensor) The RNN step memory to be shrinked.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "RankTable",
   "comment" : "(LoDRankTable) The lod_rank_table of dynamic RNN.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "I",
   "comment" : "(LoDTensor) The step index. The RNN step memory 'X' will be shrinked to match the size of the input of the index'th step.",
3460 3461 3462 3463 3464 3465
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3466
   "comment" : "(LoDTensor) The shrinked RNN step memory.",
3467 3468 3469 3470
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3471
},{
3472 3473
 "type" : "precision_recall",
 "comment" : "\nPrecision Recall Operator.\n\nWhen given Input(Indices) and Input(Labels), this operator can be used\nto compute various metrics including:\n1. macro average precision\n2. macro average recall\n3. macro f1 score\n4. micro average precision\n5. micro average recall\n6. micro f1 score\n\nTo compute the above metrics, we need to do statistics for true positives,\nfalse positives and false negatives. Here the count of true negatives is not\nnecessary, but counting it may provide potential usage and the cost is\ntrivial, so the operator also provides the count of true negatives.\n\nWe define state as a 2-D tensor with shape [class_number, 4]. Each row of a\nstate contains statistic variables for corresponding class. Layout of each row\nis: TP(true positives), FP(false positives), TN(true negatives),\nFN(false negatives). If Input(Weights) is provided, TP, FP, TN, FN will be\ncalculated by given weight instead of the instance count.\n\nThis operator also supports metrics computing for cross-batch situation. To\nachieve this, Input(StatesInfo) should be provided. State of current batch\ndata will be accumulated to Input(StatesInfo) and Output(AccumStatesInfo)\nis the accumulation state.\n\nOutput(BatchMetrics) is metrics of current batch data while\nOutput(AccumStatesInfo) is metrics of accumulation data.\n\n",
3474 3475
 "inputs" : [ 
 { 
3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497
   "name" : "MaxProbs",
   "comment" : "(Tensor, default Tensor<float>) A 2-D tensor with shape N x 1, where N is the batch size. Each row contains the max probability of an instance which computed by the previous top_k (k=1) operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Indices",
   "comment" : "(Tensor, default Tensor<int>) A 2-D tensor with shape N x 1, where N is the batch size. Each row contains the corresponding index which computed by the previous top_k (k=1) operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Labels",
   "comment" : "(Tensor, default Tensor<int>) A 2-D tensor with shape N x 1, where N is the batch size. Each element is a label and the value should be in [0, class_number - 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weights",
   "comment" : "(Tensor, default Tensor<float>) A 2-D tensor with shape N x 1, where N is the batch size. This input is optional. If provided, weight of instance would be considered when computing metrics.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "StatesInfo",
   "comment" : "(Tensor, default Tensor<int>) A 2-D tensor with shape D x 4, where D is the number of classes. This input is optional. If provided, current state will be accumulated to this state and the accumulation state will be the output state.",
3498 3499 3500 3501 3502
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514
   "name" : "BatchMetrics",
   "comment" : "(Tensor, default Tensor<float>) A 1-D tensor with shape {6}. This output tensor contains metrics for current batch data. The layout is [macro average precision, macro average recall, macro f1 score, micro average precision, micro average recall, micro f1 score].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "AccumMetrics",
   "comment" : "(Tensor, default Tensor<float>) A 1-D tensor with shape {6}. This output tensor contains metrics for accumulated data. The layout is [macro average precision, macro average recall, macro f1 score, micro average precision, micro average recall, micro f1 score].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "AccumStatesInfo",
   "comment" : "(Tensor, default Tensor<float>) A 2-D tensor with shape D x 4, where D is equal to class number. This output tensor contains accumulated state variables used to compute metrics. The layout for each class is [true positives, false positives, true negatives, false negatives].",
3515 3516 3517
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
3518 3519
 "attrs" : [ 
 { 
3520
   "name" : "class_number",
3521
   "type" : "int",
3522
   "comment" : "(int) Number of classes to be evaluated.",
3523 3524
   "generated" : 0
 } ] 
3525
},{
3526 3527
 "type" : "merge_lod_tensor",
 "comment" : "\n        Merge True and False branches of LoDTensor into a single Output,\n        with a mask at certain lod level. X is used to obtain complete\n        lod information. Please refer to SplitLoDTensorOp.",
3528 3529
 "inputs" : [ 
 { 
3530
   "name" : "X",
3531
   "comment" : "The input LoDTensor, contains complete lod information to construct the output",
3532 3533 3534
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546
   "name" : "Mask",
   "comment" : "A bool column vector which mask the input",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "InTrue",
   "comment" : "The True branch to be merged",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "InFalse",
   "comment" : "The False branch to be merged",
3547 3548 3549 3550 3551
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
3552
   "name" : "Out",
3553
   "comment" : "The merged output LoDTensor",
3554 3555 3556 3557 3558
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
3559 3560 3561
   "name" : "level",
   "type" : "int",
   "comment" : "(int) the specific lod level to rank.",
3562 3563
   "generated" : 0
 } ] 
3564 3565
},{
 "type" : "reshape",
3566
 "comment" : "\nReshape Operator.\n\nReshape Input(X) into the shape specified by Attr(shape).\n\nAn example:\nGiven a 2-D tensor X with 2 rows and 2 columns : [[1, 2], [3, 4]]\n\nand target shape = [1, 4], the reshape operator will transform\nthe tensor X into a 2-D tensor: [[1, 2, 3, 4]]\n\nOne dimension in the target shape can be set -1, representing that its\nsize is unknown. In this case, the real dimension will be infered from \nthe original shape of Input(X) and other dimensions in the target shape.\n",
3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The input tensor of reshape operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output tensor of reshape operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "shape",
   "type" : "int array",
   "comment" : "(vector<int>) Target shape of reshape operator.",
   "generated" : 0
 } ] 
3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643
},{
 "type" : "sigmoid_cross_entropy_with_logits",
 "comment" : "\nSigmoidCrossEntropyWithLogits Operator.\n\nThis measures the element-wise probability error in classification tasks\nin which each class is independent. This can be thought of as predicting labels\nfor a data-point, where labels are not mutually exclusive.\nFor example, a news article can be about politics, technology or sports\nat the same time or none of these.\n\nThe logistic loss is given as follows:\n\n       $$loss = -Labels * \\log(\\sigma(X)) - (1 - Labels) * \\log(1 - \\sigma(X))$$\n\nWe know that $$\\sigma(X) = (1 / (1 + \\exp(-X)))$$. By substituting this we get:\n\n       $$loss = X - X * Labels + \\log(1 + \\exp(-X))$$\n\nFor stability and to prevent overflow of $$\\exp(-X)$$ when X < 0,\nwe reformulate the loss as follows:\n\n       $$loss = \\max(X, 0) - X * Labels + \\log(1 + \\exp(-|X|))$$\n\nBoth the input `X` and `Labels` can carry the LoD (Level of Details) information.\nHowever the output only shares the LoD with input `X`.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape N x D, where N is the batch size and D is the number of classes. This input is a tensor of logits computed by the previous  operator. Logits are unscaled log probabilities given as log(p/(1-p)).",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor of the same type and shape as X. This input is a tensor of probabalistic labels for each logit",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape N x D  of elementwise logistic losses.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "fill",
 "comment" : "Fill operator\n\nFill an tensor with `value` and `shape`. The type of the tensor is specify by\n`dtype`.\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) The output tensor.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "value",
   "type" : "float array",
   "comment" : "The float values of tensor, which are flatten in row major",
   "generated" : 0
 }, { 
   "name" : "shape",
   "type" : "int array",
   "comment" : "The shape of output tensor",
   "generated" : 0
 }, { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "The data type of output tensor, Default is float",
   "generated" : 0
 }, { 
   "name" : "force_cpu",
   "type" : "bool",
   "comment" : "Whether the output tensor must be at CPU memory or not. Default is false.",
   "generated" : 0
 } ] 
3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667
},{
 "type" : "sequence_reshape",
 "comment" : "\nSequence Reshape Operator.\n\nThis operator will rearrange the input sequences. The new dimension is set by\nattribute and length of each sequence may change longer or shorter which is\ndecided by original length, original dimension and new dimension. The following\nexample will help to illustrate the function of this operator:\n\nx is a LoDTensor:\n    x.lod  = [[0, 2, 6]]\n    x.data = [[1, 2], [3, 4],\n              [5, 6], [7, 8], [9, 10], [11, 12]]\n    x.dims = [6, 2]\n\nset new_dim = 4\n\nthen out is a LoDTensor:\n    out.lod  = [[0, 1, 3]]\n    out.data = [[1, 2, 3, 4],\n                [5, 6, 7, 8], [9, 10, 11, 12]]\n    out.dims = [3, 4]\n\nCurrently, only 1-level LoDTensor is supported and please make sure (original\nlength * original dimension) can be divided by new_dim with no remainder for\neach sequence.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor, default LoDTensor<float>) A 2-D LoDTensor with shape being [N, M].",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor, default LoDTensor<float>) A 2-D LoDTensor with shape [T, new_dim] where T is calculated based on X.lod, M and new_dim.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "new_dim",
   "type" : "int",
   "comment" : "Sequence dimension of the output LoDTensor.",
   "generated" : 0
 } ] 
3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701
},{
 "type" : "huber_loss",
 "comment" : "\nHuberLoss Operator.\n\nHuber loss is a loss function used in robust regression. We define X as the\ninput value and Y as the target value. Huber loss can evaluate the fitness of\nX to Y. Different from MSE loss, Huber loss is more robust for outliers. The\nshape of X and Y are [batch_size, 1]. The equation is:\n\n$$\nOut_{\\delta}(X, Y)_i =\n\\begin{cases}\n0.5 * (Y_i - X_i)^2,\n\\quad |Y_i - X_i| \\leq \\delta \\\\\n\\delta * (|Y_i - X_i| - 0.5 * \\delta),\n\\quad otherwise\n\\end{cases}\n$$\n\nIn the above equation, $Out_\\delta(X, Y)_i$, $X_i$ and $Y_i$ represent the ith\nelement of Out, X and Y.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The input value of huber loss op.X is a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "The target value of huber loss op.Y is a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Residual",
   "comment" : "Intermediate tensor to cache residual value between Y and X.The shape is same as Input(X) and will be reused in backward.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Out",
   "comment" : "The output tensor with shape [batch_size, 1] which represents the huber loss.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "delta",
   "type" : "float",
   "comment" : "Hyper parameter in huber loss.",
   "generated" : 0
 } ] 
3702
},{
3703
 "type" : "sequence_softmax",
3704
 "comment" : "\nSequence Softmax Operator.\n\nSequenceSoftmaxOp computes the softmax activation among all time-steps for each\nsequence. The dimension of each time-step should be 1. Thus, the shape of\ninput Tensor can be either [N, 1] or [N], where N is the sum of the length\nof all sequences.\n\nThe algorithm works as follows:\n\n    for i-th sequence in a mini-batch:\n\n$$\nOut(X[lod[i]:lod[i+1]], :) = \\\n\\frac{\\exp(X[lod[i]:lod[i+1], :])} \\\n{\\sum(\\exp(X[lod[i]:lod[i+1], :]))}\n$$\n\nFor example, for a mini-batch of 3 sequences with variable-length,\neach containing 2, 3, 2 time-steps, the lod of which is [0, 2, 5, 7],\nthen softmax will be computed among X[0:2, :], X[2:5, :], X[5:7, :]\nand N turns out to be 7.\n\n",
3705 3706 3707
 "inputs" : [ 
 { 
   "name" : "X",
3708
   "comment" : "(LoDTensor) 1-D or 2-D input LoDTensor with the 2-nd dimension of length 1.",
3709 3710 3711 3712 3713
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
3714
   "name" : "Out",
3715
   "comment" : "(LoDTensor) 1-D or 2-D output LoDTensor with the 2-nd dimension of length 1.",
3716 3717 3718 3719
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773
},{
 "type" : "multiclass_nms",
 "comment" : "\nThis operator is to do multi-class non maximum suppression (NMS) on a batched\nof boxes and scores.\n\nIn the NMS step, this operator greedily selects a subset of detection bounding\nboxes that have high scores larger than score_threshold, if providing this\nthreshold, then selects the largest nms_top_k confidences scores if nms_top_k\nis larger than -1. Then this operator pruns away boxes that have high IOU\n(intersection over union) overlap with already selected boxes by adaptive\nthreshold NMS based on parameters of nms_threshold and nms_eta.\n\nAftern NMS step, at most keep_top_k number of total bboxes are to be kept\nper image if keep_top_k is larger than -1.\n\nThis operator support multi-class and batched inputs. It applying NMS\nindependently for each class. The outputs is a 2-D LoDTenosr, for each\nimage, the offsets in first dimension of LoDTensor are called LoD, the number\nof offset is N + 1, where N is the batch size. If LoD[i + 1] - LoD[i] == 0,\nmeans there is no detected bbox for this image. If there is no detected boxes\nfor all images, all the elements in LoD are 0, and the Out only contains one\nvalue which is -1.\n",
 "inputs" : [ 
 { 
   "name" : "BBoxes",
   "comment" : "(Tensor) A 2-D Tensor with shape [M, 4] represents the predicted locations of M bounding bboxes. Each bounding box has four coordinate values and the layout is [xmin, ymin, xmax, ymax].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Scores",
   "comment" : "(Tensor) A 3-D Tensor with shape [N, C, M] represents the predicted confidence predictions. N is the batch size, C is the class number, M is number of bounding boxes. For each category there are total M scores which corresponding M bounding boxes.  Please note, M is equal to the 1st dimension of BBoxes. ",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) A 2-D LoDTensor with shape [No, 6] represents the detections. Each row has 6 values: [label, confidence, xmin, ymin, xmax, ymax], No is the total number of detections in this mini-batch. For each instance, the offsets in first dimension are called LoD, the number of offset is N + 1, if LoD[i + 1] - LoD[i] == 0, means there is no detected bbox.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "background_label",
   "type" : "int",
   "comment" : "(int64_t, defalut: 0) The index of background label, the background label will be ignored. If set to -1, then all categories will be considered.",
   "generated" : 0
 }, { 
   "name" : "score_threshold",
   "type" : "float",
   "comment" : "(float) Threshold to filter out bounding boxes with low confidence score. If not provided, consider all boxes.",
   "generated" : 0
 }, { 
   "name" : "nms_top_k",
   "type" : "int",
   "comment" : "(int64_t) Maximum number of detections to be kept according to the confidences aftern the filtering detections based on score_threshold",
   "generated" : 0
 }, { 
   "name" : "nms_threshold",
   "type" : "float",
   "comment" : "(float, defalut: 0.3) The threshold to be used in NMS.",
   "generated" : 0
 }, { 
   "name" : "nms_eta",
   "type" : "float",
   "comment" : "(float) The parameter for adaptive NMS.",
   "generated" : 0
 }, { 
   "name" : "keep_top_k",
   "type" : "int",
   "comment" : "(int64_t) Number of total bboxes to be kept per image after NMS step. -1 means keeping all bboxes after NMS step.",
   "generated" : 0
 } ] 
3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797
},{
 "type" : "sequence_erase",
 "comment" : "\nSequence Erase Operator.\n\nSequence erase operator erases tokens specified by Attr(tokens) from the input \nsequences Input(X), and outputs the remaining data and modifies the LoD \ninformation at the same time. For example, given a 2-D LoDTensor\n\n    X = [[2, 2, 6, 1, 3, 9, 6, 1, 0, 1]]^T\n\nwith lod = [[0, 3, 6, 10]], there are three sequences in the input:\n   \n     X1 = [[2, 2, 6]]^T, X2 = [[1, 3, 9]]^T and X3 = [[6, 1, 0, 1]]^T.\n\nIf the tokens to be erased are Attr(tokens) = [2, 3, 5], after the erasing \noperation, the three sequences become\n\n    X1' = [[6]]^T, X2' = [[1, 9]]^T and X3' = [[6, 1, 0, 1]]^T.\n\nHence the LoDTensor Output(Out) should be\n\n    Out = [[6, 1, 9, 6, 1, 0, 1]]^T,\n\nwith lod = [[0, 1, 3, 7]].\n\nAn example usage for this operator is to remove the special tokens when \ncomputing the edit distance between two strings, such as blank, start token, \nand end token.\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(2-D LoDTensor with the 2nd dim. equal to 1) Input LoDTensor of SequenceEraseOp.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(2-D LoDTensor with the 2nd dim. equal to 1) Output LoDTensor of SequenceEraseOp.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "tokens",
   "type" : "int array",
   "comment" : "(vector<int>) Tokens need to be erased from input sequences.",
   "generated" : 0
 } ] 
3798 3799 3800 3801 3802 3803 3804
},{
 "type" : "scale",
 "comment" : "\nScale operator\n\n$$Out = scale*X$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) Input tensor of scale operator.",
3805 3806
   "duplicable" : 0,
   "intermediate" : 0
3807 3808 3809 3810 3811
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) Output tensor of scale operator.",
3812 3813 3814
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
3815 3816
 "attrs" : [ 
 { 
3817
   "name" : "scale",
3818
   "type" : "float",
3819
   "comment" : "(float, default 1.0)The scaling factor of the scale operator.",
3820 3821
   "generated" : 0
 } ] 
3822
},{
3823 3824
 "type" : "mean",
 "comment" : "\nMean Operator.\n\nOut is a scalar which is the mean of all elements in X. \n\n",
3825 3826 3827
 "inputs" : [ 
 { 
   "name" : "X",
3828
   "comment" : "The input of mean op",
3829 3830 3831 3832 3833 3834
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3835
   "comment" : "The output of mean op",
3836 3837 3838 3839
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3840
},{
3841 3842
 "type" : "lookup_table",
 "comment" : "\nLookup Table Operator.\n\nThis operator is used to perform lookups on the parameter W,\nthen concatenated into a dense tensor.\n\nThe input Ids can carry the LoD (Level of Details) information,\nor not. And the output only shares the LoD information with input Ids.\n\n",
3843 3844
 "inputs" : [ 
 { 
3845 3846
   "name" : "W",
   "comment" : "An input represents embedding tensors, which is a learnable parameter.",
3847 3848
   "duplicable" : 0,
   "intermediate" : 0
3849
 }, { 
3850 3851
   "name" : "Ids",
   "comment" : "An input with type int32 or int64 contains the ids to be looked up in W. Ids must be a column vector with rank = 2. The 2nd dimension size must be 1.",
3852 3853 3854
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
3855
 "outputs" : [ 
3856
 { 
3857
   "name" : "Out",
3858
   "comment" : "The lookup results, which have the same type as W.",
3859 3860 3861
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
3862
 "attrs" : [ 
3863
 { 
3864 3865 3866 3867
   "name" : "is_sparse",
   "type" : "bool",
   "comment" : "(boolean, default false) Sparse update",
   "generated" : 0
3868
 }, { 
3869 3870 3871 3872 3873
   "name" : "padding_idx",
   "type" : "long",
   "comment" : "(int64, default -1) If the value is -1, it makes no effect to lookup. Otherwise the given value indicates padding the output with zeros whenever lookup encounters it in Ids.",
   "generated" : 0
 } ] 
3874
},{
3875 3876
 "type" : "lod_tensor_to_array",
 "comment" : "",
3877 3878 3879
 "inputs" : [ 
 { 
   "name" : "X",
3880
   "comment" : "",
3881 3882 3883
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
3884 3885
   "name" : "RankTable",
   "comment" : "",
3886 3887 3888 3889 3890 3891
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3892
   "comment" : "",
3893 3894 3895 3896
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919
},{
 "type" : "logical_xor",
 "comment" : "logical_xor Operator\n\nIt operates element-wise on X and Y, and returns the Out. X, Y and Out are N-dim boolean tensors.\nEach element of Out is calculated by $$Out = (X || Y) \\, \\&\\& \\, !(X \\&\\& Y)$$\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) Left hand operand of logical_xor operator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(LoDTensor) Right hand operand of logical_xor operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is $$Out = (X || Y) \\, \\&\\& \\, !(X \\&\\& Y)$$",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948
},{
 "type" : "log_loss",
 "comment" : "\nLogLoss Operator.\n\nLog loss is a loss function used for binary classification. Log Loss quantifies\nthe accuracy of a classifier by penalising false classifications. Minimising the\nLog Loss is equivalent to maximising the accuracy of the classifier. We define\nPredicted as the values predicted by our model and Labels as the target ground\ntruth value. Log loss can evaluate how close the predicted values are to the\ntarget. The shapes of Predicted and Labels are both [batch_size, 1].\nThe equation is:\n\n$$\nLoss = - Labels * log(Predicted + \\epsilon) -\n        (1 - Labels) * log(1 - Predicted + \\epsilon)\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "Predicted",
   "comment" : "The input value (Predicted) of Log loss op.Predicted is a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Labels",
   "comment" : "The target value (Labels) of Log loss op.Labels is a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Loss",
   "comment" : "The output tensor with shape [batch_size, 1] which represents the log loss.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "Epsilon in log loss.",
   "generated" : 0
 } ] 
3949
},{
3950 3951
 "type" : "sqrt",
 "comment" : "\nSqrt Activation Operator.\n\n$out = \\sqrt{x}$\n\n",
3952 3953 3954
 "inputs" : [ 
 { 
   "name" : "X",
3955
   "comment" : "Input of Sqrt operator",
3956 3957 3958 3959 3960 3961
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3962
   "comment" : "Output of Sqrt operator",
3963 3964 3965 3966 3967
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
3968 3969
 "type" : "lod_reset",
 "comment" : "LoDReset operator\n\nReset LoD of Input(X) into a new one specified by Input(TargetLoD) or\nAttr(target_lod), or set LoD for Input(X) if it doesn't have one.\nCurrently the lod_reset operator only supports the reset of level 0 LoD.\nAt least one of Input(TargetLoD) and Attr(target_lod) must be set,\nand if both of them are set, Input(TargetLoD) will be chosen as the\ntarget LoD.\n\nAn example:\nGiven a float LoDTensor X with shape (6, 1), its transpose form represents\n\n    [1.0, 2.0, 3.0, 4.0, 5.0, 6.0],\n\nwith LoD = [[0, 2, 5, 6]] and the three (transposed) sequences look like\n\n    [1.0, 2.0], [3.0, 4.0, 5.0], [6.0].\n\nIf target LoD = [0, 4, 6], the lod_reset operator will reset the LoD and\nthe sequences that the LoDTensor Output(Out) contains becomes:\n\n    [1.0, 2.0, 3.0, 4.0], [5.0, 6.0].\n\n",
3970 3971 3972
 "inputs" : [ 
 { 
   "name" : "X",
3973
   "comment" : "(LoDTensor) The input tensor of lod_reset operator.",
3974 3975 3976
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
3977 3978
   "name" : "TargetLoD",
   "comment" : "(Tensor, optional) The target level 0 LoD from Input().",
3979 3980 3981 3982 3983 3984
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
3985
   "comment" : "(LoDTensor) The output tensor of lod_reset operator.",
3986 3987 3988 3989 3990
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
3991 3992 3993
   "name" : "target_lod",
   "type" : "int array",
   "comment" : "The target level 0 LoD from Attr().",
3994 3995
   "generated" : 0
 } ] 
3996
},{
3997 3998
 "type" : "write_to_array",
 "comment" : "\nWriteToArray Operator.\n\nThis operator writes a LoDTensor to a LoDTensor array.\n\nAssume $T$ is LoDTensor, $i$ is the subscript of the array, and $A$ is the array. The\nequation is\n\n$$A[i] = T$$\n\n",
3999 4000 4001
 "inputs" : [ 
 { 
   "name" : "X",
4002
   "comment" : "(LoDTensor) the tensor will be written to tensor array",
4003 4004 4005
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4006 4007
   "name" : "I",
   "comment" : "(Tensor) the subscript index in tensor array. The number of element should be 1",
4008 4009 4010 4011 4012 4013
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4014
   "comment" : "(TensorArray) the tensor array will be written",
4015 4016 4017
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4018
 "attrs" : [  ] 
4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036
},{
 "type" : "lod_array_length",
 "comment" : "\nLoDArrayLength Operator.\n\nThis operator obtains the length of lod tensor array:\n\n$$Out = len(X)$$\n\nNOTE: The output is a CPU Tensor since the control variable should be only in\nCPU and the length of LoDTensorArray should be used as control variables.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensorArray) The input tensor array.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) 1x1 CPU Tensor of length, int64_t",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
4037 4038
},{
 "type" : "edit_distance",
4039
 "comment" : "\n\nEditDistance operator computes the edit distances between a batch of hypothesis\nstrings and their references.\n\nEdit distance, also called Levenshtein distance, measures how dissimilar two strings\nare by counting the minimum number of operations to transform one string into anthor.\nHere the operations include insertion, deletion, and substitution. For example,\ngiven hypothesis string A = \"kitten\" and reference B = \"sitting\", the edit distance\nis 3 for A will be transformed into B at least after two substitutions and one\ninsertion:\n\n   \"kitten\" -> \"sitten\" -> \"sittin\" -> \"sitting\"\n\nInput(Hyps) is a LoDTensor consisting of all the hypothesis strings with the total\nnumber denoted by `batch_size`, and the separation is specified by the LoD information.\nAnd the `batch_size` reference strings are arranged in order in the same way in the\nLoDTensor Input(Refs).\n\nOutput(Out) contains the `batch_size` results and each stands for the edit stance\nfor a pair of strings respectively. If Attr(normalized) is true, the edit distance\nwill be divided by the length of reference string.\n",
4040
 "inputs" : [ 
4041 4042
 { 
   "name" : "Hyps",
4043
   "comment" : "(2-D LoDTensor<int64_t>, 2nd dim. equal to 1) The indices for hypothesis strings.",
4044 4045 4046
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4047
   "name" : "Refs",
4048
   "comment" : "(2-D LoDTensor<int64_t>, 2nd dim. equal to 1) The indices for reference strings.",
4049 4050
   "duplicable" : 0,
   "intermediate" : 0
4051 4052 4053
 } ], 
 "outputs" : [ 
 { 
4054 4055 4056 4057 4058
   "name" : "SequenceNum",
   "comment" : "The sequence count of current batch",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4059 4060
   "name" : "Out",
   "comment" : "(2-D Tensor with shape [`batch_size` x 1]) The output edit distances of EditDistance operator.",
4061 4062 4063 4064 4065
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4066 4067 4068
   "name" : "normalized",
   "type" : "bool",
   "comment" : "(bool, default false) Indicated whether to normalize the edit distance by the length of reference string.",
4069 4070
   "generated" : 0
 } ] 
4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157
},{
 "type" : "layer_norm",
 "comment" : "\nLayer Normalization.\n\nLayer Norm has been implemented as discussed in the paper:\nhttps://arxiv.org/abs/1607.06450\n...\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) The input tensor.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Scale",
   "comment" : "(Tensor, optional) Scale is a 1-dimensional tensor of size H(`begin_norm_axis` splits the tensor(`X`) to a matrix [N,H]).It is applied to the output.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor, optional) Bias is a 1-dimensional tensor of size H(`begin_norm_axis` splits the tensor(`X`) to a matrix [N,H]).It is applied to the output.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Y",
   "comment" : "(LoDTensor) Result after normalization.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Mean",
   "comment" : "(Tensor) Mean of the current mini batch.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Variance",
   "comment" : "(Tensor) Variance of the current mini batch.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [ 
 { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1e-5) Constant for numerical stability",
   "generated" : 0
 }, { 
   "name" : "begin_norm_axis",
   "type" : "int",
   "comment" : "(int default:1), the axis of `begin_norm_axis ... Rank(X) - 1` will be normalized. `begin_norm_axis` splits the tensor(`X`) to a matrix [N,H].",
   "generated" : 0
 } ] 
},{
 "type" : "gaussian_random",
 "comment" : "\nGaussianRandom Operator.\n\nUsed to initialize tensors with gaussian random generator.\n\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output matrix of gaussian random op",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "shape",
   "type" : "int array",
   "comment" : "(vector<int>) The dimension of random tensor.",
   "generated" : 0
 }, { 
   "name" : "mean",
   "type" : "float",
   "comment" : "(float, default 0.0) mean of random tensor.",
   "generated" : 0
 }, { 
   "name" : "std",
   "type" : "float",
   "comment" : "(float, default 1.0) std of random tensor.",
   "generated" : 0
 }, { 
   "name" : "seed",
   "type" : "int",
   "comment" : "(int, default 0) Random seed of generator.0 means use system wide seed.",
   "generated" : 0
 }, { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "(int, default 5(FP32)) Output data type.",
   "generated" : 0
 } ] 
4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234
},{
 "type" : "lrn",
 "comment" : "\nLocal Response Normalization Operator.\n\nThis operator comes from the paper:\n<<ImageNet Classification with Deep Convolutional Neural Networks>>.\n\nThe original formula is:\n\n$$\nOutput(i, x, y) = Input(i, x, y) / \\left(\nk + \\alpha \\sum\\limits^{\\min(C, c + n/2)}_{j = \\max(0, c - n/2)}\n(Input(j, x, y))^2\n\\right)^{\\beta}\n$$\n\nFunction implementation:\n\nInputs and outpus are in NCHW format, while input.shape.ndims() equals 4.\nAnd dimensions 0 ~ 3 represent batch size, feature maps, rows,\nand columns, respectively.\n\nInput and Output in the formula above is for each map(i) of one image, and\nInput(i, x, y), Output(i, x, y) represents an element in an image.\n\nC is the number of feature maps of one image. n is a hyper-parameter\nconfigured when operator is initialized. The sum in the denominator\nis the sum of the same positions in the neighboring maps.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input of LRN operator. It must be a 4D tenor with NCHW format.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output of LRN operator, which is also the 4D tensor with NCHW format.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MidOut",
   "comment" : "(Tensor) Middle result of LRN operator. It's computed in forward process and also used in backward process.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "n",
   "type" : "int",
   "comment" : "(int default 5) n is the \"adjacent\" kernel that maps at the same spatial position.",
   "generated" : 0
 }, { 
   "name" : "k",
   "type" : "float",
   "comment" : "(float, default 2.0) k is the bias.",
   "generated" : 0
 }, { 
   "name" : "alpha",
   "type" : "float",
   "comment" : "(float, default 0.0001) alpha is the scale number.",
   "generated" : 0
 }, { 
   "name" : "beta",
   "type" : "float",
   "comment" : "(float, default 0.75) beta is the power number.",
   "generated" : 0
 } ] 
},{
 "type" : "bilinear_tensor_product",
 "comment" : "\nBilinear Tensor Product operator.\nGiven input X and Y, a 3D tensor Weight and a Bias. Each column of the\nOutput is computed by one slice $i = 1, . . . , k$ of the tensor:\n\n$$\nM =  (X W_i) * Y \\\\\nOut_i = \\sum_j {M_j} + Bias_i\n$$\n\nWhere $W_i$ is the $i$-th slice of Input(Weight);\n      $M_j$ is the $j$-th column of $M$;\n      $Out_i$ is the $i$-th column of Output(Out);\n      $Bias_i$ is a column vector, each element of it is equal to\n        the $i$-th element of $Bias$;\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The first input of bilinear_tensor_product operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "The second input of bilinear_tensor_product operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "The learnable parameters of bilinear_tensor_product operator.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "The learnable bias of bilinear_tensor_product operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output of bilinear_tensor_product operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291
},{
 "type" : "iou_similarity",
 "comment" : "\nIOU Similarity Operator.\nComputes intersection-over-union (IOU) between two box lists.\n Box list 'X' should be a LoDTensor and 'Y' is a common Tensor,\n boxes in 'Y' are shared by all instance of the batched inputs of X.\n Given two boxes A and B, the calculation of IOU is as follows:\n\n$$\nIOU(A, B) = \n\\frac{area(A\\cap B)}{area(A)+area(B)-area(A\\cap B)}\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor, default LoDTensor<float>) Box list X is a 2-D LoDTensor with shape [N, 4] holds N boxes, each box is represented as [xmin, ymin, xmax, ymax], the shape of X is [N, 4]. [xmin, ymin] is the left top coordinate of the box if the input is image feature map, they are close to the origin of the coordinate system. [xmax, ymax] is the right bottom coordinate of the box. This tensor can contain LoD information to represent a batch of inputs. One instance of this batch can contain different numbers of entities.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(Tensor, default Tensor<float>) Box list Y holds M boxes, each box is represented as [xmin, ymin, xmax, ymax], the shape of X is [N, 4]. [xmin, ymin] is the left top coordinate of the box if the input is image feature map, and [xmax, ymax] is the right bottom coordinate of the box.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor, the lod is same as input X) The output of iou_similarity op, a tensor with shape [N, M] representing pairwise iou scores.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "conditional_block",
 "comment" : "Conditional block operator\n\nRun the sub-block if X is not empty. Params is the other inputs and Out is the\noutputs of the sub-block.\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "The conditional variable of this operator. If X is empty, the whole sub-block will not be executed.",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "Params",
   "comment" : "The input variables of the sub-block.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output variables of the sub-block.",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "Scope",
   "comment" : "(std::vector<Scope*>) The step scope of conditional block. To unify the conditional block, rnn and while op, the type of scope is std::vector<Scope*>",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "sub_block",
   "type" : "block id",
   "comment" : "The step block of conditional block operator",
   "generated" : 0
 } ] 
4292
},{
4293 4294
 "type" : "rmsprop",
 "comment" : "\nRmsprop Optimizer. \n\n$$\nMeanSquareOut = decay * MeanSquare + (1 - decay) * Grad * Grad \\\\\nMomentOut = momentum * Moment +\n            \\frac{LearningRate * Grad}{\\sqrt{MeanSquareOut + epsilon}} \\\\\nParamOut = Param -  MomentOut\n$$\n\nThe original slides that proposed Rmsprop: Slide 29 of\nhttp://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf)\n\n",
4295 4296
 "inputs" : [ 
 { 
4297 4298
   "name" : "Param",
   "comment" : "(Tensor, default Tensor<float>) Input parameter value that has to be updated.",
4299 4300 4301
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318
   "name" : "MeanSquare",
   "comment" : "(Tensor, default Tensor<float>) The mean square value that gets updated.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor, default Tensor<float>) The learning rate should be a tensor of size 1.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor, default Tensor<float>) Input gradient of the parameter.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment",
   "comment" : "(Tensor, default Tensor<float>) The moment that gets updated.",
4319 4320 4321 4322 4323
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335
   "name" : "ParamOut",
   "comment" : "(Tensor) Output updated parameter value.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MomentOut",
   "comment" : "(Tensor) Output updated moment.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MeanSquareOut",
   "comment" : "(Tensor) Output Mean squared updated value.",
4336 4337 4338 4339 4340
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4341 4342 4343
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1e-10) Constant for numerical stability.",
4344 4345
   "generated" : 0
 }, { 
4346 4347 4348 4349 4350 4351 4352 4353
   "name" : "decay",
   "type" : "float",
   "comment" : "(float, default 0.9) Discounting factor for coming gradient.",
   "generated" : 0
 }, { 
   "name" : "momentum",
   "type" : "float",
   "comment" : "(float, default 0.0) Constant value.",
4354 4355 4356
   "generated" : 0
 } ] 
},{
4357
 "type" : "elementwise_mul",
4358
 "comment" : "\nLimited Elementwise Mul Operator.\n\nThe equation is:\n\n$$Out = X \\odot\\ Y$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
4359 4360
 "inputs" : [ 
 { 
4361
   "name" : "X",
4362
   "comment" : "(Tensor), The first input tensor of elementwise op.",
4363 4364 4365
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4366
   "name" : "Y",
4367
   "comment" : "(Tensor), The second input tensor of elementwise op.",
4368 4369 4370 4371 4372
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4373
   "name" : "Out",
4374
   "comment" : "The output of elementwise op.",
4375 4376 4377 4378 4379
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4380 4381
   "name" : "axis",
   "type" : "int",
4382
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
4383 4384 4385
   "generated" : 0
 } ] 
},{
4386 4387
 "type" : "sequence_slice",
 "comment" : "\nSequence slice operator\n\nThe operator crops a subsequence from given sequence with given start offset and subsequence length.\nIt only supports sequence (LoD Tensor with level number is 1).\n- Case:\n    X = [[a1, a2;\n        b1, b2;\n        c1, c2]\n       [d1, d2;\n        e1, e2]]\n    LoD(X) = {{0, 3, 5}}; Dims(X) = (5, 2)\n    Offset = [[0], [1]]; Length = [[2], [1]]\n\n    Out = [[a1, a2;\n            b1, b2]\n            [e1, e2]]\n    LoD(Out) = {{0, 2, 3}}; Dims(Out) = (3, 2)\nNOTE: The first dimension size of input, the size of offset and Length, should be equal. The offset start from 0.\n    ",
4388 4389
 "inputs" : [ 
 { 
4390 4391
   "name" : "X",
   "comment" : "(LoDTensor), the input of SequenceSliceOp.",
4392 4393 4394
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4395 4396 4397 4398 4399 4400 4401
   "name" : "Offset",
   "comment" : "(Tensor), a vector<int> to describe the offset of every input sequence for sub sequence item.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Length",
   "comment" : "(Tensor), a vector<int> to describe the length of every input sequence for sub sequence item.",
4402 4403 4404 4405 4406
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4407 4408
   "name" : "Out",
   "comment" : "(LoDTensor), the output of SequenceSliceOp.",
4409 4410 4411
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4412
 "attrs" : [  ] 
4413
},{
4414 4415
 "type" : "hinge_loss",
 "comment" : "\nHingeLoss Operator.\n\nLet x be a logit (prediction) and y be the actual label. The logit can\ntake any values from (-inf, inf), but the labels should be either -1 or 1.\nThen, the hinge loss is computed as follows:\n\n$$\nL_(x, y) = max(1 - y.x, 0) \n$$\n\nNote that the labels passed as input will have values as either 0 or 1.\n\n",
4416 4417
 "inputs" : [ 
 { 
4418 4419 4420 4421 4422 4423 4424
   "name" : "Logits",
   "comment" : "The input value (Logits) of Hinge loss op.Logits is a 2-D tensor with shape [batch_size, 1].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Labels",
   "comment" : "The target value (Labels) of Hinge loss op.Labels is a 2-D tensor with shape [batch_size, 1].",
4425 4426 4427 4428 4429
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4430 4431
   "name" : "Loss",
   "comment" : "The output tensor with shape [batch_size, 1] which represents the hinge loss.",
4432 4433 4434 4435
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
4436
},{
4437 4438
 "type" : "fill_constant",
 "comment" : "\nFillConstantBatchSizeLike Operator.\n\nFill up a variable with specified constant value.\n\n",
4439 4440 4441 4442
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4443
   "comment" : "(Tensor) Tensor of specified shape will be filled with the specified value",
4444 4445 4446 4447 4448
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4449 4450 4451
   "name" : "dtype",
   "type" : "int",
   "comment" : "(int, default 5 (FP32)) Output data type",
4452 4453 4454 4455
   "generated" : 0
 }, { 
   "name" : "shape",
   "type" : "int array",
4456
   "comment" : "(vector<int>) The shape of the output",
4457 4458
   "generated" : 0
 }, { 
4459 4460 4461
   "name" : "value",
   "type" : "float",
   "comment" : "(float, default 0) The value to be filled",
4462 4463 4464 4465
   "generated" : 0
 }, { 
   "name" : "force_cpu",
   "type" : "bool",
4466
   "comment" : "(bool, default false) Force fill output variable to cpu memory. Otherwise, fill output variable to the running device",
4467 4468
   "generated" : 0
 } ] 
4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527
},{
 "type" : "detection_output",
 "comment" : "\n          detection output for SSD(single shot multibox detector)\n          Apply the NMS to the output of network and compute the predict\n          bounding box location. The output’s shape of this layer could\n          be zero if there is no valid bounding box.\n        ",
 "inputs" : [ 
 { 
   "name" : "Loc",
   "comment" : "(Tensor) The input tensor of detection_output operator.The input predict locationsThe format of input tensor is kNCHW. Where K is priorbox point numbers,N is How many boxes are there on each point, C is 4, H and W both are 1.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Conf",
   "comment" : "(Tensor) The input tensor of detection_output operator.The input priorbox confidence.The format of input tensor is kNCHW. Where K is priorbox point numbers,N is How many boxes are there on each point, C is the number of classes, H and W both are 1.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "PriorBox",
   "comment" : "(Tensor) The input tensor of detection_output operator.The format of input tensor is the position and variance of the boxes",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of detection_output operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "background_label_id",
   "type" : "int",
   "comment" : "(int), The background class index.",
   "generated" : 0
 }, { 
   "name" : "num_classes",
   "type" : "int",
   "comment" : "(int), The number of the classification.",
   "generated" : 0
 }, { 
   "name" : "nms_threshold",
   "type" : "float",
   "comment" : "(float), The Non-maximum suppression threshold.",
   "generated" : 0
 }, { 
   "name" : "confidence_threshold",
   "type" : "float",
   "comment" : "(float), The classification confidence threshold.",
   "generated" : 0
 }, { 
   "name" : "top_k",
   "type" : "int",
   "comment" : "(int), The bbox number kept of the layer’s output.",
   "generated" : 0
 }, { 
   "name" : "nms_top_k",
   "type" : "int",
   "comment" : "(int), The bbox number kept of the NMS’s output.",
   "generated" : 0
 } ] 
4528
},{
4529 4530
 "type" : "fill_zeros_like",
 "comment" : "\nFillZerosLike Operator.\n\nFill up a variable with zeros.\nThe output will have the same size as the input.\n\n",
4531 4532 4533
 "inputs" : [ 
 { 
   "name" : "X",
4534
   "comment" : "The input of fill-zeros-like op.",
4535 4536 4537 4538 4539
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4540
   "name" : "Out",
4541
   "comment" : "The variable will be filled up with zeros.",
4542 4543 4544 4545 4546
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
4547 4548
 "type" : "softmax_with_cross_entropy",
 "comment" : "\nSoftmax With Cross Entropy Operator.\n\nCross entropy loss with softmax is used as the output layer extensively. This\noperator computes the softmax normalized values for each row of the input\ntensor, after which cross-entropy loss is computed. This provides a more\nnumerically stable gradient.\n\nBecause this operator performs a softmax on logits internally, it expects\nunscaled logits. This operator should not be used with the output of\nsoftmax operator since that would produce incorrect results.\n\nWhen the attribute soft_label is set false, this operators expects mutually\nexclusive hard labels, each sample in a batch is in exactly one class with a\nprobability of 1.0. Each sample in the batch will have a single label.\n\nThe equation is as follows:\n\n1) Hard label (one-hot label, so every sample has exactly one class)\n\n$$Loss_j =  -\\text{Logit}_{Label_j} +\n\\log\\left(\\sum_{i=0}^{K}\\exp(\\text{Logit}_i)\\right),\nj = 1,..., K$$\n\n2) Soft label (each sample can have a distribution over all classes)\n\n$$Loss_j =  -\\sum_{i=0}^{K}\\text{Label}_i \\left(\\text{Logit}_i -\n\\log\\left(\\sum_{i=0}^{K}\\exp(\\text{Logit}_i)\\right)\\right),\nj = 1,...,K$$\n\n",
4549 4550
 "inputs" : [ 
 { 
4551 4552
   "name" : "Logits",
   "comment" : "(Tensor, default: Tensor<float>), The unscaled log probabilities which is a 2-D tensor with shape [N x K]. N is the batch_size, and K is the class number.",
4553 4554 4555
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4556 4557
   "name" : "Label",
   "comment" : "(Tensor) The ground truth which is a 2-D tensor. If soft_label is set to false, Label is a Tensor<int64> with shape [N x 1]. If soft_label is set to true, Label is a Tensor<float/double> with shape [N x K].",
4558 4559 4560 4561 4562
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4563 4564
   "name" : "Softmax",
   "comment" : "(Tensor, default: Tensor<float>), A 2-D tensor with shape [N x K]. The outputs value of softmax activation by given the input batch, which will be used in backward calculation.",
4565 4566 4567
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
4568 4569
   "name" : "Loss",
   "comment" : "(Tensor, default: Tensor<float>), A 2-D tensor. The cross entropy loss with shape [N x 1].",
4570 4571 4572 4573 4574
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4575 4576 4577
   "name" : "soft_label",
   "type" : "bool",
   "comment" : "(bool, default: false), A flag to indicate whether to interpretate the given labels as soft labels.",
4578 4579
   "generated" : 0
 } ] 
4580
},{
4581 4582
 "type" : "fill_constant_batch_size_like",
 "comment" : "\nFillConstantBatchSizeLike Operator.\n\nFill up a variable with specified constant value.\n\n",
4583 4584
 "inputs" : [ 
 { 
4585 4586
   "name" : "Input",
   "comment" : "(Tensor) Tensor whose dim_idx th dimension is used to specify the batch_size",
4587 4588 4589 4590 4591 4592
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4593
   "comment" : "(Tensor) Tensor of specified shape will be filled with the specified value",
4594 4595 4596
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4597 4598
 "attrs" : [ 
 { 
4599
   "name" : "dtype",
4600
   "type" : "int",
4601
   "comment" : "(int, default 5 (FP32)) Output data type",
4602 4603
   "generated" : 0
 }, { 
4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621
   "name" : "shape",
   "type" : "int array",
   "comment" : "(vector<int>) The shape of the output",
   "generated" : 0
 }, { 
   "name" : "input_dim_idx",
   "type" : "int",
   "comment" : "(int, default 0) The index of input's batch size dimension",
   "generated" : 0
 }, { 
   "name" : "output_dim_idx",
   "type" : "int",
   "comment" : "(int, default 0) The index of output's batch size dimension",
   "generated" : 0
 }, { 
   "name" : "value",
   "type" : "float",
   "comment" : "(float, default 0) The value to be filled",
4622 4623
   "generated" : 0
 } ] 
4624
},{
4625
 "type" : "tanh",
4626
 "comment" : "\nTanh Activation Operator.\n\n$$out = \\frac{e^{x} - e^{-x}}{e^{x} + e^{-x}}$$\n\n",
4627 4628 4629
 "inputs" : [ 
 { 
   "name" : "X",
4630
   "comment" : "Input of Tanh operator",
4631 4632 4633 4634 4635
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4636
   "name" : "Out",
4637
   "comment" : "Output of Tanh operator",
4638 4639 4640 4641 4642
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
4643 4644
 "type" : "feed",
 "comment" : "\nFeed Operator.\n\nIt should not be configured by users directly.\n\n",
4645 4646 4647
 "inputs" : [ 
 { 
   "name" : "X",
4648
   "comment" : "The input of feed op",
4649 4650 4651 4652 4653 4654
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4655
   "comment" : "The output of feed op",
4656 4657 4658 4659 4660
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4661
   "name" : "col",
4662
   "type" : "int",
4663
   "comment" : "(int) The column of feed",
4664 4665
   "generated" : 0
 } ] 
4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694
},{
 "type" : "label_smooth",
 "comment" : "\nLabelSmooth Operator.\n\nLabel smoothing is a mechanism to regularize the classifier layer. In machine \nlearning, optimizing the log-likelihood of the correct label directly may \ncause two problems. First, it may result in overfitting: if the model learns \nto assign full probability to the ground-truth label for each training example,\nit is not guaranteed to generalize. Second, it encourages the differences \nbetween the largest logit and all others to become large, reducing the ability \nof the model to adapt. Label smoothing is proposed to encourage the model to \nbe less confident, which replaces the ground-truth label $y$ with the weighted \nsum of itself and some fixed distribution $\\mu$, i.e.\n\n$$\n    \\tilde{y} = (1 - \\epsilon) * y + \\epsilon * \\mu,\n$$\n\nwhere $(1 - \\epsilon)$ and $\\epsilon$ are the weights respectively, and \n$\\tilde{y}$ is the smoothed label. Usually uniform distribution is used for \n$\\mu$. This change in the ground-truth label is called label-smoothing \nregularization or LSR.\n\nSee more details about label smoothing in https://arxiv.org/abs/1512.00567.\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor) The input labels of LabelSmooth operator. This input can be batched labels in one-hot encoding or output from softmax, with shape [N x K], where N is the batch size and K is the number of classes",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "PriorDist",
   "comment" : "(Tensor, optional)The prior distribution to be added to the smoothed label. It is fixed during training and the number of elements should be equal to the dimension K of each label. Default is uniform distribution and each element will be set to 1/K if not provided in input.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(loDTensor) The smoothed label of LabelSmooth operator. It hasthe same shape and LoD with the Input(LoDTensor).",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 0.0f)The smoothing parameter of LabelSmooth operator.",
   "generated" : 0
 } ] 
4695
},{
4696
 "type" : "expand",
4697
 "comment" : "\nExpand operator tiles the input by given times number. You should set times\nnumber for each dimension by providing attribute 'expand_times'. The rank of X\nshould be in [1, 6]. Please note that size of 'expand_times' must be the same\nwith X's rank. Following is a using case:\n\nInput(X) is a 3-D tensor with shape [2, 3, 1]:\n\n        [\n           [[1], [2], [3]],\n           [[4], [5], [6]]\n        ]\n\nAttr(expand_times):  [1, 2, 2]\n\nOutput(Out) is a 3-D tensor with shape [2, 6, 2]:\n\n        [\n            [[1, 1], [2, 2], [3, 3], [1, 1], [2, 2], [3, 3]],\n            [[4, 4], [5, 5], [6, 6], [4, 4], [5, 5], [6, 6]]\n        ]\n\n",
4698 4699 4700
 "inputs" : [ 
 { 
   "name" : "X",
4701
   "comment" : "(Tensor, default Tensor<float>). A tensor with rank in [1, 6].X is the input to be expanded.",
4702 4703 4704 4705 4706 4707
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4708
   "comment" : "(Tensor, default Tensor<float>). A tensor with rank in [1, 6].The rank of Output(Out) have the same with Input(X). After expanding, size of each dimension of Output(Out) is equal to size of the corresponding dimension of Input(X) multiplying the corresponding value given by Attr(expand_times).",
4709 4710 4711
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4712 4713 4714 4715 4716 4717 4718
 "attrs" : [ 
 { 
   "name" : "expand_times",
   "type" : "int array",
   "comment" : "Expand times number for each dimension.",
   "generated" : 0
 } ] 
4719 4720
},{
 "type" : "elementwise_min",
4721
 "comment" : "\nLimited Elementwise Max Operator.\n\nThe equation is:\n\n$$Out = min(X, Y)$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
4722 4723 4724
 "inputs" : [ 
 { 
   "name" : "X",
4725
   "comment" : "(Tensor), The first input tensor of elementwise op.",
4726 4727 4728 4729
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
4730
   "comment" : "(Tensor), The second input tensor of elementwise op.",
4731 4732 4733 4734 4735 4736
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4737
   "comment" : "The output of elementwise op.",
4738 4739 4740 4741 4742 4743 4744
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
4745
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
4746 4747
   "generated" : 0
 } ] 
4748
},{
4749
 "type" : "elementwise_div",
4750
 "comment" : "\nLimited Elementwise Div Operator.\n\nThe equation is:\n\n$$Out = X / Y$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
4751 4752 4753
 "inputs" : [ 
 { 
   "name" : "X",
4754
   "comment" : "(Tensor), The first input tensor of elementwise op.",
4755 4756 4757 4758
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
4759
   "comment" : "(Tensor), The second input tensor of elementwise op.",
4760 4761 4762 4763 4764 4765
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4766
   "comment" : "The output of elementwise op.",
4767 4768 4769
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4770 4771 4772 4773
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
4774
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
4775 4776
   "generated" : 0
 } ] 
4777
},{
4778
 "type" : "elementwise_add",
4779
 "comment" : "\nLimited Elementwise Add Operator.\n\nThe equation is:\n\n$$Out = X + Y$$\n\n$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be\nsmaller than or equal to the dimensions of $X$.\n\nThere are two cases for this operator:\n1. The shape of $Y$ is same with $X$;\n2. The shape of $Y$ is a subset of $X$.\n\nFor case 2:\n$Y$ will be broadcasted to match the shape of $X$ and axis should be\nset to index of the start dimension to broadcast $Y$ onto $X$.\n\nFor example\n  .. code-block:: python\n\n    shape(X) = (2, 3, 4, 5), shape(Y) = (,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (5,)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)\n    shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1\n    shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0\n\nEither of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)\ninformation. However, the output only shares the LoD information with input $X$.\n\n",
4780 4781
 "inputs" : [ 
 { 
4782
   "name" : "X",
4783
   "comment" : "(Tensor), The first input tensor of elementwise op.",
4784 4785 4786
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
4787
   "name" : "Y",
4788
   "comment" : "(Tensor), The second input tensor of elementwise op.",
4789 4790 4791 4792 4793
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4794
   "name" : "Out",
4795
   "comment" : "The output of elementwise op.",
4796 4797 4798 4799 4800
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4801
   "name" : "axis",
4802
   "type" : "int",
4803
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
4804 4805 4806
   "generated" : 0
 } ] 
},{
4807 4808
 "type" : "cross_entropy",
 "comment" : "\nCrossEntropy Operator.\n\nIt supports both standard cross-entropy and soft-label cross-entropy loss\ncomputation.\n1) One-hot cross-entropy:\n    soft_label = false, Label[i, 0] indicates the class index for sample i:\n\n                $Y[i] = -\\log(X[i, Label[i]])$\n\n2) Soft-label cross-entropy:\n    soft_label = true, Label[i, j] indicates the soft label of class j\n    for sample i:\n\n                $Y[i] = \\sum_j{-Label[i, j] * log(X[i, j])}$\n\n   Please make sure that in this case the summuation of each row of Label\n   equals one.\n\n3) One-hot cross-entropy with vecterized Input(Label):\n     As a special case of 2), when each row of Input(Label) has only one\n     non-zero element (equals 1), soft-label cross-entropy degenerates to a\n     one-hot cross-entropy with one-hot label representation.\n\nBoth the input X and Label can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input X.\n\n",
4809 4810 4811
 "inputs" : [ 
 { 
   "name" : "X",
4812
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape [N x D], where N is the batch size and D is the number of classes. This input is a probability computed by the previous operator, which is almost always the result of a softmax operator.",
4813 4814 4815 4816
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
4817
   "comment" : "(Tensor), the ground truth which is a 2-D tensor. When soft_label is set to false, Label is a Tensor<int64> with shape [N x 1]. When soft_label is set to true, Label is a Tensor<float/double> with shape [N x D].",
4818 4819 4820 4821 4822 4823
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Y",
4824
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape [N x 1]. The cross entropy loss.",
4825 4826 4827 4828 4829
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
4830 4831 4832
   "name" : "soft_label",
   "type" : "bool",
   "comment" : "(bool, default false), a flag indicating whether to interpretate the given labels as soft labels.",
4833 4834 4835
   "generated" : 0
 } ] 
},{
4836
 "type" : "matmul",
4837
 "comment" : "\nMatMul Operator.\n\n\nThis operator is used to perform (batched) matrix multiplication\nover the last two dimensions of the input tensors `X` and `Y`.\n\nIf a transpose flag is specified, the last two dimensions of the\ntensor are transposed. If the tensor is rank-1 of shape [D], then\nfor `X` it is treated as [1, D] in nontransposed form and as [D, 1]\nin transposed form, whereas for `Y` it is the opposite: It is treated\nas [D, 1] in nontransposed form and as [1, D] in transposed form.\n\nExamples without transpose:\n- X: [K], Y: [K] => Out: [1]\n- X: [K], Y: [K, N] => Out: [N]\n- X: [B, M, K], Y: [K] => Out: [B, M]\n- X: [M, K], Y: [B, K, N] => Out: [B, M, N]\n- X: [B, M, K], Y: [B, K, N] => Out: [B, M, N]\n- X: [B, ..., M, K], Y: [B, ..., K, N] => Out: [B, ..., M, N]\n\nThe behavior is designed to be similar to the `numpy.matmul` function.\nThe differences are:\n- When the rank of the input data is less than or equal to 3, it\n  is similar to the `numpy.matmul` function.\n- When the rank of the input is greater than 3, the rank of X and\n  Y must be equal, and the first `rank - 2` dimensions must be equal.\n- We add `transpose_X` and `transpose_Y` flags.\n\nBoth the input `X` and `Y` can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input `X`.\n\n",
4838 4839 4840
 "inputs" : [ 
 { 
   "name" : "X",
4841 4842 4843 4844 4845 4846
   "comment" : "The first input of MatMul op",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "The second input of MatMul op",
4847 4848 4849 4850 4851 4852
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4853
   "comment" : "The output of MatMul op",
4854 4855 4856
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868
 "attrs" : [ 
 { 
   "name" : "transpose_X",
   "type" : "bool",
   "comment" : "If true, use the transpose of `X`.\n        ",
   "generated" : 0
 }, { 
   "name" : "transpose_Y",
   "type" : "bool",
   "comment" : "If true, use the transpose of `Y`.\n        ",
   "generated" : 0
 } ] 
4869
},{
4870 4871
 "type" : "dropout",
 "comment" : "\nDropout Operator.\n\nDropout refers to randomly dropping out units in a nerual network. It is a\nregularization technique for reducing overfitting by preventing neuron\nco-adaption during training. The dropout operator randomly set (according to\nthe given dropout probability) the outputs of some units to zero, while others\nare set equal to their corresponding inputs.\n\n",
4872 4873 4874
 "inputs" : [ 
 { 
   "name" : "X",
4875 4876
   "comment" : "The input of dropout op.",
   "duplicable" : 0,
4877 4878 4879 4880 4881
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
4882
   "comment" : "The output of dropout op.",
4883 4884
   "duplicable" : 0,
   "intermediate" : 0
4885 4886 4887 4888 4889
 }, { 
   "name" : "Mask",
   "comment" : "The random sampled dropout mask.",
   "duplicable" : 0,
   "intermediate" : 1
4890 4891 4892
 } ], 
 "attrs" : [ 
 { 
4893 4894 4895
   "name" : "dropout_prob",
   "type" : "float",
   "comment" : "Probability of setting units to zero.",
4896 4897
   "generated" : 0
 }, { 
4898 4899 4900 4901
   "name" : "is_test",
   "type" : "bool",
   "comment" : "True if in test phase.",
   "generated" : 0
4902 4903 4904 4905 4906
 }, { 
   "name" : "fix_seed",
   "type" : "bool",
   "comment" : "A flag indicating whether to use a fixed seed to generate random mask. NOTE: DO NOT set this flag to true in training. Setting this flag to true is only useful in unittest or for debug that always the same output units will be dropped.",
   "generated" : 0
4907 4908
 }, { 
   "name" : "seed",
4909
   "type" : "int",
4910
   "comment" : "Dropout random seed.",
4911 4912 4913
   "generated" : 0
 } ] 
},{
4914 4915
 "type" : "fetch",
 "comment" : "\nFetch Operator.\n\nIt should not be configured by users directly.\n\n",
4916 4917 4918
 "inputs" : [ 
 { 
   "name" : "X",
4919
   "comment" : "The input of fetch op",
4920 4921 4922 4923 4924
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4925 4926
   "name" : "Out",
   "comment" : "The output of fetch op",
4927 4928 4929
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4930 4931 4932 4933 4934 4935 4936
 "attrs" : [ 
 { 
   "name" : "col",
   "type" : "int",
   "comment" : "(int) The column of fetch",
   "generated" : 0
 } ] 
4937
},{
4938 4939
 "type" : "squared_l2_distance",
 "comment" : "\nSquaredL2Distance operator\n\nThis operator will cacluate the squared L2 distance for the input and \nthe target. Number of distance value will be equal to the first dimension \nof input. First dimension of the target could be equal to the input or to 1. \nIf the first dimension of target is 1, the operator will broadcast target's \nfirst dimension to input's first dimension. During backward propagation, \nthe user can decide whether to calculate the gradient of the input or \nthe target or both.\n\nBoth the input X and Y can carry the LoD (Level of Details) information. \nHowever, the output only shares the LoD information with input X.\n    ",
4940 4941 4942
 "inputs" : [ 
 { 
   "name" : "X",
4943 4944 4945 4946 4947 4948
   "comment" : "(Tensor) Input of SquaredL2DistanceOp.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(Tensor) Target of SquaredL2DistanceOp.",
4949 4950 4951 4952 4953
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4954 4955 4956 4957 4958
   "name" : "sub_result",
   "comment" : "(Tensor) Buffering subtraction result which will be reused in backward.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
4959
   "name" : "Out",
4960
   "comment" : "(Tensor) Squared l2 distance between input and target.",
4961 4962 4963
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4964
 "attrs" : [  ] 
4965
},{
4966 4967
 "type" : "while",
 "comment" : "\n",
4968 4969 4970
 "inputs" : [ 
 { 
   "name" : "X",
4971 4972 4973 4974 4975 4976 4977
   "comment" : "A set of variables, which are required by operators inside the block of While Op.",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "Condition",
   "comment" : "(Bool) An scalar. When it's False, the While Op will be terminated.",
   "duplicable" : 1,
4978 4979 4980 4981
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
4982 4983 4984 4985 4986 4987 4988
   "name" : "Out",
   "comment" : "A set of variables, which will be assigned with values generated by the operators inside the block of While Op.",
   "duplicable" : 1,
   "intermediate" : 0
 }, { 
   "name" : "StepScopes",
   "comment" : "(StepScopeVar) A vector of local scope, which size equals the step number of While Op. The i'th scope storages temporary variables generated in the i'th step.",
4989 4990 4991
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
4992 4993
 "attrs" : [ 
 { 
4994
   "name" : "sub_block",
4995 4996 4997 4998
   "type" : "block id",
   "comment" : "The step block inside WhileOp",
   "generated" : 0
 } ] 
4999
},{
5000
 "type" : "relu",
5001
 "comment" : "\nRelu Activation Operator.\n\n$out = \\max(x, 0)$\n\n",
5002 5003 5004
 "inputs" : [ 
 { 
   "name" : "X",
5005
   "comment" : "Input of Relu operator",
5006 5007 5008 5009 5010
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5011
   "name" : "Out",
5012
   "comment" : "Output of Relu operator",
5013 5014 5015 5016 5017
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
5018 5019
 "type" : "decayed_adagrad",
 "comment" : "\nDecayed Adagrad Optimizer.\n\nThe update is done as follows:\n\n$$\nmoment\\_out = decay * moment + (1 - decay) * grad * grad \\\\\nparam\\_out = param - \\frac{learning\\_rate * grad}{\\sqrt{moment\\_out} + epsilon}\n$$\n\nThe original paper(http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf)\ndoes not have an epsilon attribute. It is added here for numerical\nstability to avoid the division by zero error.\n\n",
5020 5021
 "inputs" : [ 
 { 
5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Moment",
   "comment" : "(Tensor) Second moment",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor) Learning rate",
5039 5040 5041 5042 5043
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5044 5045 5046 5047 5048 5049 5050
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "MomentOut",
   "comment" : "(Tensor) Output second moment",
5051 5052 5053 5054 5055
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5056 5057 5058 5059 5060 5061 5062 5063
   "name" : "decay",
   "type" : "float",
   "comment" : "(float, default 0.95) Discounting factor for coming gradient",
   "generated" : 0
 }, { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1.0e-6) Constant for numerical stability",
5064 5065
   "generated" : 0
 } ] 
5066 5067
},{
 "type" : "gru",
5068
 "comment" : "\nGRU Operator implements part calculations of the complete GRU as following:\n\n$$\nupdate\\_gate: u_t = actGate(xu_t + W_u * h_{t-1} + b_u) \\\\\nreset\\_gate: r_t = actGate(xr_t + W_r * h_{t-1} + b_r)  \\\\\noutput\\_candidate: {h}_t = actNode(xc_t + W_c * dot(r_t, h_{t-1}) + b_c) \\\\\noutput: h_t = dot((1 - u_t), h_{t-1}) + dot(u_t, {h}_t)\n$$\n\n@note To implement the complete GRU, fully-connected operator must be used\nbefore to feed xu, xr and xc as the Input of GRU operator.\n",
5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(LoDTensor) The first input is a LodTensor, which supports variable-time length input sequence. The underlying tensor in this LoDTenosr is a matrix with shape (T X 3D), where, T is the total time steps in this mini-batch, D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "H0",
   "comment" : "(Tensor, optional) The initial hidden state is an optional input. This is a tensor with shape (N x D), where N is the batch size, D is the hidden size.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(Tensor) The learnable hidden-hidden weight matrix with shape (D x 3D), where D is the hidden size. The elements continuous in memory can be divided into two parts. The first part are weights of the update gate and reset gate with shape (D x 2D), and the second part are weights of output candidate with shape (D x D).",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor, optional) Bias vector with shape (1 x 3D) concating bias of the update gate, reset gate and output candidate.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "BatchGate",
   "comment" : "(LoDTensor) To compute with batches, sequence data will be reorganized into several successive batches each containing data from the same time step. The LoDTensor BatchGate contains the update gate, reset gate and output candidate values organized in batches. The LoD size is 2. The first LoD contains the batch offsets and the second LoD contains the indexes in the raw sequence data.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "BatchResetHiddenPrev",
   "comment" : "(LoDTensor) The reseted hidden state LoDTensor organized in batches. This LoDTensor is a matrix with shape (T X D) and has the same LoD with `BatchGate`.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "BatchHidden",
   "comment" : "(LoDTensor) The hidden state LoDTensor organized in batches.  This LoDTensor is a matrix with shape (T X D) and has the same LoD with `BatchGate`.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "Hidden",
   "comment" : "(LoDTensor) the hidden state LoDTensor organized in sequences. This LoDTensor is a matrix with shape (T X D) and has the same LoD with `BatchGate`.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "activation",
   "type" : "string",
   "comment" : "(string, default tanh) The activation type used for output candidate {h}_t.",
   "generated" : 0
 }, { 
   "name" : "gate_activation",
   "type" : "string",
   "comment" : "(string, default sigmoid) The activation type used in update gate and reset gate.",
   "generated" : 0
 }, { 
   "name" : "is_reverse",
   "type" : "bool",
   "comment" : "(bool, defalut: False) whether to compute reversed GRU.",
   "generated" : 0
 } ] 
},{
 "type" : "ctc_align",
 "comment" : "\nCTCAlign op is used to merge repeated elements between two blanks\nand then delete all blanks in sequence.\n\nGiven:\n    Input.data = [0, 1, 2, 2, 0, 4, 0, 4, 5, 0, 6,\n                  6, 0, 0, 7, 7, 7, 0]\n    Input.dims = {18, 1}\n    Input.LoD = [[0, 11, 18]]\n\nAnd:\n    blank = 0\n    merge_repeated = True\n\nThen:\n    Output.data = [1, 2, 4, 4, 5, 6,\n                   6, 7]\n    Output.dims = {8, 1}\n    Output.LoD = [[0, 6, 8]]\n\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(LodTensor, default: LoDTensor<int>), Its shape is [Lp, 1], where Lp is the sum of all input sequences' length.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Output",
   "comment" : "(Tensor, default: Tensor<int>), The align result.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "blank",
   "type" : "int",
   "comment" : "(int, default: 0), the blank label setted in Connectionist Temporal Classification (CTC) op.",
   "generated" : 0
 }, { 
   "name" : "merge_repeated",
   "type" : "bool",
   "comment" : "(bool, default: true), whether to merge repeated elements between two blanks. ",
   "generated" : 0
 } ] 
5159
},{
5160 5161
 "type" : "beam_search",
 "comment" : "This is a beam search operator that help to generate sequences.",
5162 5163
 "inputs" : [ 
 { 
5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175
   "name" : "pre_ids",
   "comment" : "ids in previous step",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "ids",
   "comment" : "a LoDTensor of shape of [None,k]",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "scores",
   "comment" : "a LoDTensor that has the same shape and LoD with `ids`",
5176 5177 5178 5179 5180
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5181 5182 5183 5184 5185 5186 5187
   "name" : "selected_ids",
   "comment" : "a LoDTensor that stores the IDs selected by beam search",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "selected_scores",
   "comment" : "a LoDTensor that has the same shape and LoD with `selected_ids`",
5188 5189 5190 5191 5192
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5193
   "name" : "level",
5194
   "type" : "int",
5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205
   "comment" : "the level of LoDTensor",
   "generated" : 0
 }, { 
   "name" : "beam_size",
   "type" : "int",
   "comment" : "beam size for beam search",
   "generated" : 0
 }, { 
   "name" : "end_id",
   "type" : "int",
   "comment" : "the token id which indicates the end of a sequence",
5206 5207 5208
   "generated" : 0
 } ] 
},{
5209 5210
 "type" : "split_lod_tensor",
 "comment" : "\n        Split a LoDTensor with a Mask at certain level. The input LoDTensor\n        has 3 sequence at certain lod level. The Mask is a bool column vector,\n        such as [0, 1, 0] at the same level. The first and third sequence will\n        be send to False Output LoDTensor; whereas the second sequence will\n        be send to True Output LoDTensor. Please refer to MergeLoDTensorOp.",
5211 5212 5213
 "inputs" : [ 
 { 
   "name" : "X",
5214
   "comment" : "The input LoDTensor",
5215 5216 5217
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5218 5219
   "name" : "Mask",
   "comment" : "A bool column vector which mask the input",
5220 5221 5222 5223 5224
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5225 5226 5227 5228 5229 5230 5231
   "name" : "OutTrue",
   "comment" : "True branch of input LoDTensor",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "OutFalse",
   "comment" : "False branch of input LoDTensor",
5232 5233 5234 5235 5236
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5237 5238 5239
   "name" : "level",
   "type" : "int",
   "comment" : "(int) the specific lod level to split.",
5240 5241 5242
   "generated" : 0
 } ] 
},{
5243
 "type" : "crop",
5244
 "comment" : "\nCrop Operator.\n\nCrop input into output, as specified by offsets and shape.\n\nThere are two ways to set shape:\n1. reference input: crop input X into the same shape as reference input.\n                    The dimension of reference input should\n                    be the same as the dimension of input X.\n2. shape list: crop input X into the shape described by a list<int>.\n               The size of shape list should be the same as\n               the dimension size of input X.\n\nThe input should be a k-D tensor(k > 0 and k < 7). As an example:\n\nCase 1:\nGiven\n\n    X = [[0, 1, 2, 0, 0]\n         [0, 3, 4, 0, 0]\n         [0, 0, 0, 0, 0]],\n\nand\n\n    offsets = [0, 1],\n\nand\n\n    shape = [2, 2],\n\nwe get:\n\n    Out = [[1, 2],\n           [3, 4]].\n\n\nCase 2:\nGiven\n\n    X = [[0, 1, 2, 5, 0]\n         [0, 3, 4, 6, 0]\n         [0, 0, 0, 0, 0]],\n\nand\n\n    offsets = [0, 1],\n\nand\n\n    Y = [[0, 0, 0]\n         [0, 0, 0]],\n\nwe get:\n\n    Out = [[1, 2, 5],\n           [3, 4, 6]].\n",
5245 5246 5247
 "inputs" : [ 
 { 
   "name" : "X",
5248
   "comment" : "The input of pad op. The input should be a k-D tensor(k > 0 and k < 7).",
5249 5250 5251
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5252 5253
   "name" : "Y",
   "comment" : "The input used as reference for cropping, which is of the same dimensions as X.",
5254 5255 5256 5257 5258
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5259 5260
   "name" : "Out",
   "comment" : "The output of crop op, which is of the same dimensions as X.",
5261 5262 5263 5264 5265
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5266 5267 5268 5269 5270 5271 5272 5273
   "name" : "offsets",
   "type" : "int array",
   "comment" : "A list<int> describing offsets to be cropped. The size of offsets list should be the same as the dimension size of input X.",
   "generated" : 0
 }, { 
   "name" : "shape",
   "type" : "int array",
   "comment" : "A list<int> describing the shape of output. The size of shape list should be the same as the dimension size of input X.",
5274 5275 5276
   "generated" : 0
 } ] 
},{
5277
 "type" : "brelu",
5278
 "comment" : "\nBRelu Activation Operator.\n\n$out = \\max(\\min(x, t_{min}), t_{max})$\n\n",
5279 5280
 "inputs" : [ 
 { 
5281 5282
   "name" : "X",
   "comment" : "Input of BRelu operator",
5283 5284 5285 5286 5287
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5288
   "name" : "Out",
5289
   "comment" : "Output of BRelu operator",
5290 5291 5292 5293 5294
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5295
   "name" : "t_min",
5296
   "type" : "float",
5297
   "comment" : "The min marginal value of BRelu",
5298 5299
   "generated" : 0
 }, { 
5300 5301 5302
   "name" : "t_max",
   "type" : "float",
   "comment" : "The max marginal value of BRelu",
5303 5304 5305
   "generated" : 0
 } ] 
},{
5306 5307
 "type" : "crf_decoding",
 "comment" : "\nThe crf_decoding operator reads the emission feature weights and the transition\nfeature weights learned by the linear_chain_crf operator. It implements the\nViterbi algorithm which is a dynamic programming algorithm for finding the most\nlikely sequence of hidden states, called the Viterbi path, that results in a\nsequence of observed tags.\n\nThe output of this operator changes according to whether Input(Label) is given:\n\n1. Input(Label) is given:\n\nThis happens in training. This operator is used to co-work with the chunk_eval\noperator.\n\nWhen Input(Label) is given, the crf_decoding operator returns a row vector\nwith shape [N x 1] whose values are fixed to be 0, indicating an incorrect\nprediction, or 1 indicating a tag is correctly predicted. Such an output is the\ninput to chunk_eval operator.\n\n2. Input(Label) is not given:\n\nThis is the standard decoding process.\n\nThe crf_decoding operator returns a row vector with shape [N x 1] whose values\nrange from 0 to maximum tag number - 1. Each element indicates an index of a\npredicted tag.\n",
5308 5309
 "inputs" : [ 
 { 
5310 5311
   "name" : "Emission",
   "comment" : "(LoDTensor, default: LoDTensor<float>). A LoDTensor with shape [N x D] where N is the size of the mini-batch and D is the total tag number. This input is the unscaled emission weight matrix of the linear_chain_crf operator.",
5312 5313 5314
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5315 5316
   "name" : "Transition",
   "comment" : "(Tensor, default: Tensor<float>). A Tensor with shape [(D + 2) x D]. This input is the transition weights learned by the linear_chain_crf operator, denoted as w. The 1st row of w are transition weights for the start mask. The 2nd row of w are transition weights for the end mask. Transition weights between other tags begin from the 3rd row of w. See more details in comments of the linear_chain_crf operator.",
5317 5318 5319
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5320 5321
   "name" : "Label",
   "comment" : "(LoDTensor,  LoDTensor<int64_t>). The ground truth with shape [N x 1]. This input is optional. See more details in the operator's comments.",
5322 5323 5324 5325 5326
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5327 5328
   "name" : "ViterbiPath",
   "comment" : "(LoDTensor, LoDTensor<int64_t>). The decoding results. What to return changes depending on whether the Input(Label) (the ground truth) is given. See more details in the operator's comment.",
5329 5330 5331 5332
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420
},{
 "type" : "maxout",
 "comment" : "\nMaxOut Operator.\n\nAssumed the input shape is (N, Ci, H, W).\nThe output shape is (N, Co, H, W).\nThen $Co = Ci / groups$ and the operator formula is as follows:\n\n$$\ny_{si+j} = \\max_k x_{gsi + sk + j} \\\\\ng = groups \\\\\ns = \\frac{input.size}{num\\_channels} \\\\\n0 \\le i < \\frac{num\\_channels}{groups} \\\\\n0 \\le j < s \\\\\n0 \\le k < groups\n$$\n\nPlease refer to Paper:\n  - Maxout Networks: http://www.jmlr.org/proceedings/papers/v28/goodfellow13.pdf\n  - Multi-digit Number Recognition from Street View \\\n    Imagery using Deep Convolutional Neural Networks: \\\n    https://arxiv.org/pdf/1312.6082v4.pdf\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(Tensor) The input tensor of maxout operator. The format of input tensor is NCHW. Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of maxout operator.The format of output tensor is also NCHW.Where N is batch size, C is the number of channels, H and W is the height and width of feature.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "groups",
   "type" : "int",
   "comment" : "\"Specifies how many groups the input tensor will be split\"\n        \"in the channel dimension. And the number of output channel is \"\n        \"the number of channels divided by groups..\"\n        ",
   "generated" : 0
 } ] 
},{
 "type" : "ftrl",
 "comment" : "\nFTRL (Follow The Regularized Leader) Operator.\n\nOptimizer that implements the FTRL algorithm:\n\n$$\nnew\\_accum = squared\\_accum + grad^2 \\\\\nif (lr\\_power == -0.5) {\n   linear\\_accum += grad - (\\surd(new\\_accum) - \\surd(squared\\_accum)) /\n                   (learning\\_rate * param) \\\\\n} else {\n   linear\\_accum += grad -\n                  (new\\_accum^{-lr\\_power} - accum^{-lr\\_power}) /\n                  (learning\\_rate * param) \\\\\n}\n\nx = (l1 * sign(linear\\_accum) - linear\\_accum)\nif (lr\\_power == -0.5) {\n   y = \\frac{\\surd(new\\_accum)}{learning\\_rate} + (2 * l2) \\\\\n   pre\\_shrink = \\frac{x}{y} \\\\\n   param = (abs(linear\\_accum) > l1).select(pre\\_shrink, 0.0) \\\\\n} else {\n   y = \\frac{new\\_accum^{-lr\\_power}}{learning\\_rate} + (2 * l2) \\\\\n   pre\\_shrink = \\frac{x}{y} \\\\\n   param = (abs(linear\\_accum) > l1).select(pre\\_shrink, 0.0) \\\\\n}\nsquared\\_accum += grad^2;\n$$\n\nThe paper that proposed Follow The Regularized Leader (FTRL):\n(https://www.eecs.tufts.edu/~dsculley/papers/ad-click-prediction.pdf)\n\n",
 "inputs" : [ 
 { 
   "name" : "Param",
   "comment" : "(Tensor, default Tensor<float>) Input parameter value that has to be updated.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "SquaredAccumulator",
   "comment" : "(Tensor, default Tensor<float>) Accumulator that accumulates squared gradients.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LinearAccumulator",
   "comment" : "(Tensor, default Tensor<float>) Accumulator that accumulates linear gradients.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Grad",
   "comment" : "(Tensor, default Tensor<float>) Input gradient of the parameter.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LearningRate",
   "comment" : "(Tensor, default Tensor<float>) The learning rate should be a tensor of size 1.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ParamOut",
   "comment" : "(Tensor) Output updated parameter value.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "SquaredAccumOut",
   "comment" : "(Tensor) Output accumulated squared gradients.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "LinearAccumOut",
   "comment" : "(Tensor) Output accumulated linear gradients.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "l1",
   "type" : "float",
   "comment" : "(float, default 0.0) L1 regularization strength.",
   "generated" : 0
 }, { 
   "name" : "l2",
   "type" : "float",
   "comment" : "(float, default 0.0) L2 regularization strength.",
   "generated" : 0
 }, { 
   "name" : "lr_power",
   "type" : "float",
   "comment" : "(float, default -0.5f) Learning Rate Power.",
   "generated" : 0
 } ] 
5421
},{
5422 5423
 "type" : "conv_shift",
 "comment" : "\nConvShift Operator.\n\nA layer for circular convolution of two vectors,\nas used in the Neural Turing Machine: https://arxiv.org/abs/1410.5401\n\nThe equation is:\n\n$$Out[i] = \\sum_{j=-(N-1)/2}^{(N-1)/2} X_{i+j} * Y_{j}$$\n\nwhere X's index is computed modulo M, and Y's index is computed modulo N.\n\nBoth inputs X and Y can carry LoD (Level of Details) information.\nHowever, the output only shares the LoD information with input X.\n\n",
5424 5425 5426
 "inputs" : [ 
 { 
   "name" : "X",
5427
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape B x M, where B is the batch size and M is the data dimension.",
5428 5429 5430 5431
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
5432
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape B x N, where B is the batch size and N is the data dimension. N must be odd.",
5433 5434 5435 5436 5437 5438
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
5439
   "comment" : "(Tensor, default Tensor<float>), a 2-D tensor with shape B x M, i.e., the same shape as X.",
5440 5441 5442 5443 5444
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
5445
 "type" : "sum",
5446
 "comment" : "\nSum operator.\n\nThis operators sums the input tensors. All the inputs can carry the\nLoD (Level of Details) information. However, the output only shares\nthe LoD information with the first input.\n",
5447 5448 5449
 "inputs" : [ 
 { 
   "name" : "X",
5450 5451
   "comment" : "(vector<Tensor>) The input tensors of sum operator.",
   "duplicable" : 1,
5452 5453 5454 5455
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5456 5457
   "name" : "Out",
   "comment" : "(Tensor) The output tensor of sum operator.",
5458 5459 5460 5461 5462
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
5463 5464
 "type" : "concat",
 "comment" : "\nConcat Operator.\n\nConcatenate the input tensors along dimension axis.\nExamples:\n  Input[0] = [[1,2],[3,4]]\n  Input[1] = [[5,6]]\n  axis = 0\n  Output = [[1,2],\n            [3,4],\n            [5,6]]\n\n",
5465 5466 5467
 "inputs" : [ 
 { 
   "name" : "X",
5468 5469
   "comment" : "Input tensors of concat operator.",
   "duplicable" : 1,
5470 5471 5472 5473 5474
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
5475
   "comment" : "Output tensor of concat operator.",
5476 5477 5478
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5479 5480 5481 5482 5483 5484 5485
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "The axis along which the input tensors will be concatenated.",
   "generated" : 0
 } ] 
5486
},{
5487 5488
 "type" : "less_equal",
 "comment" : "less_equal Operator\n\nIt operates element-wise on X and Y, and returns the Out. Each of them is a\nN-dim tensor. X and Y could be any type.  The each element of the Out tensor is\ncalculated by Out = X <= Y\n",
5489 5490 5491
 "inputs" : [ 
 { 
   "name" : "X",
5492 5493 5494 5495 5496 5497
   "comment" : "(LoDTensor) the left hand operand of less_equal operator",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
   "comment" : "(LoDTensor) the right hand operand of less_equal operator",
5498 5499 5500 5501 5502
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5503 5504
   "name" : "Out",
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is Out = X <= Y",
5505 5506 5507
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5508 5509 5510 5511 5512 5513 5514
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
   "generated" : 0
 } ] 
5515
},{
5516 5517
 "type" : "equal",
 "comment" : "equal Operator\n\nIt operates element-wise on X and Y, and returns the Out. Each of them is a\nN-dim tensor. X and Y could be any type.  The each element of the Out tensor is\ncalculated by Out = X == Y\n",
5518 5519 5520
 "inputs" : [ 
 { 
   "name" : "X",
5521
   "comment" : "(LoDTensor) the left hand operand of equal operator",
5522 5523 5524 5525
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Y",
5526
   "comment" : "(LoDTensor) the right hand operand of equal operator",
5527 5528 5529 5530 5531 5532
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
5533
   "comment" : "(LoDTensor) n-dim bool tensor. Each element is Out = X == Y",
5534 5535 5536
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5537 5538 5539 5540 5541 5542 5543
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default -1). The start dimension index for broadcasting Y onto X.",
   "generated" : 0
 } ] 
5544
},{
5545 5546
 "type" : "gather",
 "comment" : "\nGather Operator.\n\n$Out = X[Index]$\n\nOut is obtained by gathering entries of the outer-most dimension \nof X indexed by Index and concatenate them together.\n\nExample:\n\nX = [[1, 2],\n     [3, 4],\n     [5, 6]]\n\nIndex = [[1, 2]]\n\nThen:\n\nOut = [[3, 4],\n       [5, 6]]\n\n",
5547 5548 5549
 "inputs" : [ 
 { 
   "name" : "X",
5550 5551 5552 5553 5554 5555
   "comment" : "The source input of gather op",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Index",
   "comment" : "The index input of gather op",
5556 5557 5558 5559 5560 5561
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
5562
   "comment" : "The output of gather op",
5563 5564 5565 5566 5567
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
5568 5569
 "type" : "clip_by_norm",
 "comment" : "\nClipByNorm Operator.\n\nThis operator limits the L2 norm of the input $X$ within $max\\_norm$.\nIf the L2 norm of $X$ is less than or equal to $max\\_norm$, $Out$ will be\nthe same as $X$. If the L2 norm of $X$ is greater than $max\\_norm$, $X$ will\nbe linearly scaled to make the L2 norm of $Out$ equal to $max\\_norm$, as\nshown in the following formula:\n\n$$\nOut = \\frac{max\\_norm * X}{norm(X)},\n$$\n\nwhere $norm(X)$ represents the L2 norm of $X$.\n",
5570 5571 5572
 "inputs" : [ 
 { 
   "name" : "X",
5573
   "comment" : "(Tensor) The input of clip_by_norm op.The number of dimensions must be between [1, 9].",
5574 5575 5576 5577 5578
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5579 5580
   "name" : "Out",
   "comment" : "(Tensor) The output of clip_by_norm op with shape as input(X)",
5581 5582 5583
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5584 5585 5586 5587 5588 5589 5590 5591 5592
 "attrs" : [ 
 { 
   "name" : "max_norm",
   "type" : "float",
   "comment" : "(float) The maximum norm value.",
   "generated" : 0
 } ] 
},{
 "type" : "sigmoid",
5593
 "comment" : "\nSigmoid Activation Operator\n\n$$out = \\frac{1}{1 + e^{-x}}$$\n\n",
5594 5595 5596 5597
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Sigmoid operator",
5598 5599 5600 5601 5602
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5603
   "name" : "Out",
5604
   "comment" : "Output of Sigmoid operator",
5605 5606 5607 5608
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626
},{
 "type" : "floor",
 "comment" : "\nFloor Activation Operator.\n\n$out = floor(x)$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Floor operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "Output of Floor operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
5627
},{
5628
 "type" : "sequence_concat",
5629
 "comment" : "\nThe sequence_concat operator concatenates multiple LoDTensors.\nIt only supports sequence (LoD Tensor with level number is 1)\nor a nested sequence (LoD tensor with level number is 2) as its input.\n- Case1:\n  If the axis is other than 0(here, axis is 1 and level is 1),\n  each input should have the same LoD information and the LoD\n  information of the output keeps the same as the input.\n\n  LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)\n  LoD(x1) = {{0,2,4}, {0,1,2,3,4}}; Dims(x1) = (4,4,4)\n  LoD(Out) = {{0,2,4}, {0,1,2,3,4}}; Dims(Out) = (4,7,4)\n\n- Case2:\n  If the axis is 0(here, leve is 0), the inputs are concatenated along\n  time steps, the LoD information of the output need to re-compute.\n  The LoD information of level-1 should be same.\n\n  LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)\n  LoD(x1) = {{0,2,4}, {0,1,3,5,7}}; Dims(x1) = (7,3,4)\n  LoD(Out) = {{0,2,4}, {0,2,5,8,11}}; Dims(Out) = (11,3,4)\n\n- Case3:\n  If the axis is 0(here, level is 1).\n\n  LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)\n  LoD(x1) = {{0,3,4}, {0,1,3,5,7}}; Dims(x1) = (7,3,4)\n  LoD(Out) = {{0,5,8}, {0,1,2,3,5,7,8,9,11}}; Dims(Out) = (11,3,4)\n\n- Case4:\n  If the LoD number is 1, axis is 0, level is 0\n\n  LoD(x0) = {{0,1,2,3,4}}; Dims(x0) = (4,3,4)\n  LoD(x1) = {{0,1,3,5,7}}; Dims(x1) = (7,3,4)\n  LoD(Out) = {{0,2,5,8,11}}; Dims(Out) = (11,3,4)\n\nNOTE: The levels of all the inputs should be the same.\n    ",
5630 5631
 "inputs" : [ 
 { 
5632 5633 5634 5635 5636 5637 5638 5639 5640
   "name" : "X",
   "comment" : "(LodTensorArray) Input is a vector of LoDTensor, each of which is a variable-length sequence or nested sequence.",
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor), Variable-length output of sequence_concat Op.",
5641 5642
   "duplicable" : 0,
   "intermediate" : 0
5643 5644 5645 5646 5647 5648 5649
 } ], 
 "attrs" : [ 
 { 
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default 0) The axis along which the inputs will be joined. If axis is 0, the inputs will be joined with LoD index.",
   "generated" : 0
5650
 }, { 
5651 5652 5653 5654 5655
   "name" : "level",
   "type" : "int",
   "comment" : "(int, default 0) The level at which the inputs will be joined. If the level is 0, the inputs will be joined at the nested sequence level. If the level is 1, the inputs will be joined at the sequence level. The level should be less than the level number of inputs.",
   "generated" : 0
 } ] 
5656
},{
5657 5658
 "type" : "cast",
 "comment" : "\nCast Operator.\n\nThis Operator casts the input tensor to another data type and\nreturns tha Output Tensor.\n\n",
5659 5660 5661
 "inputs" : [ 
 { 
   "name" : "X",
5662
   "comment" : "The input tensor of cast op",
5663 5664
   "duplicable" : 0,
   "intermediate" : 0
5665 5666 5667 5668 5669
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "The output tensor of cast op",
5670 5671
   "duplicable" : 0,
   "intermediate" : 0
5672 5673 5674 5675 5676 5677 5678
 } ], 
 "attrs" : [ 
 { 
   "name" : "out_dtype",
   "type" : "int",
   "comment" : "output data type",
   "generated" : 0
5679
 }, { 
5680 5681 5682 5683 5684
   "name" : "in_dtype",
   "type" : "int",
   "comment" : "input data type",
   "generated" : 0
 } ] 
5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782
},{
 "type" : "chunk_eval",
 "comment" : "\nFor some basics of chunking, please refer to\n‘Chunking with Support Vector Machines <https://aclanthology.info/pdf/N/N01/N01-1025.pdf>’.\n\n\nCheckEvalOp computes the precision, recall, and F1-score of chunk detection,\nand supports IOB, IOE, IOBES and IO (also known as plain) tagging schemes.\nHere is a NER example of labeling for these tagging schemes:\n\n \t     Li     Ming    works  at  Agricultural   Bank   of    China  in  Beijing.\n  IO:    I-PER  I-PER   O      O   I-ORG          I-ORG  I-ORG I-ORG  O   I-LOC\n  IOB:   B-PER  I-PER   O      O   B-ORG          I-ORG  I-ORG I-ORG  O   B-LOC\n  IOE:   I-PER  E-PER   O      O   I-ORG          I-ORG  I-ORG E-ORG  O   E-LOC\n  IOBES: B-PER  E-PER   O      O   I-ORG          I-ORG  I-ORG E-ORG  O   S-LOC\n\nThere are three chunk types(named entity types) including PER(person), ORG(organization)\nand LOC(LOCATION), and we can see that the labels have the form <tag type>-<chunk type>.\n\nSince the calculations actually use label ids rather than labels, extra attention\nshould be paid when mapping labels to ids to make CheckEvalOp work. The key point\nis that the listed equations are satisfied by ids.\n\n    tag_type = label % num_tag_type\n    chunk_type = label / num_tag_type\n\nwhere `num_tag_type` is the num of tag types in the tagging scheme, `num_chunk_type`\nis the num of chunk types, and `tag_type` get its value from the following table.\n\n    Scheme Begin Inside End   Single\n     plain   0     -      -     -\n     IOB     0     1      -     -\n     IOE     -     0      1     -\n     IOBES   0     1      2     3\n\nStill use NER as example, assuming the tagging scheme is IOB while chunk types are ORG,\nPER and LOC. To satisfy the above equations, the label map can be like this:\n\n    B-ORG  0\n    I-ORG  1\n    B-PER  2\n    I-PER  3\n    B-LOC  4\n    I-LOC  5\n    O      6\n\nIt’s not hard to verify the equations noting that the num of chunk types\nis 3 and the num of tag types in IOB scheme is 2. For example, the label\nid of I-LOC is 5, the tag type id of I-LOC is 1, and the chunk type id of\nI-LOC is 2, which consistent with the results from the equations.\n",
 "inputs" : [ 
 { 
   "name" : "Inference",
   "comment" : "(Tensor, default: Tensor<int64_t>). Predictions from the network.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(Tensor, default: Tensor<int64_t>). The true tag sequences.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Precision",
   "comment" : "(float). The evaluated precision (called positive predictive value) of chunks on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Recall",
   "comment" : "(float). The evaluated recall (true positive rate or sensitivity) of chunks on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "F1-Score",
   "comment" : "(float). The evaluated F1-Score on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "NumInferChunks",
   "comment" : "(int64_t). The number of chunks in Inference on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "NumLabelChunks",
   "comment" : "(int64_t). The number of chunks in Label on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "NumCorrectChunks",
   "comment" : "(int64_t). The number of chunks both in Inference and Label on the given mini-batch.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "num_chunk_types",
   "type" : "int",
   "comment" : "(int). The number of chunk type. See below for details.",
   "generated" : 0
 }, { 
   "name" : "chunk_scheme",
   "type" : "string",
   "comment" : "(string, default IOB). The labeling scheme indicating how to encode the chunks. Must be IOB, IOE, IOBES or plain. See below for details.",
   "generated" : 0
 }, { 
   "name" : "excluded_chunk_types",
   "type" : "int array",
   "comment" : "(list<int>) A list including chunk type ids indicating chunk types that are not counted. See below for details.",
   "generated" : 0
 } ] 
},{
 "type" : "box_coder",
 "comment" : "\nBounding Box Coder Operator.\nEncode/Decode the target bounding box with the priorbox information.\nThe Encoding schema described below:\nox = (tx - px) / pw / pxv\noy = (ty - py) / ph / pyv\now = log(abs(tw / pw)) / pwv \noh = log(abs(th / ph)) / phv \nThe Decoding schema described below:\nox = (pw * pxv * tx * + px) - tw / 2\noy = (ph * pyv * ty * + py) - th / 2\now = exp(pwv * tw) * pw + tw / 2\noh = exp(phv * th) * ph + th / 2\nwhere tx, ty, tw, th denote the target box's center coordinates, width and\nheight respectively. Similarly, px, py, pw, ph denote the priorbox's(anchor)\ncenter coordinates, width and height. pxv, pyv, pwv, phv denote the variance\nof the priorbox and ox, oy, ow, oh denote the encoded/decoded coordinates,\nwidth and height.\n",
 "inputs" : [ 
 { 
   "name" : "PriorBox",
   "comment" : "(Tensor, default Tensor<float>) Box list PriorBox is a 2-D Tensor with shape [M, 4] holds M boxes, each box is represented as [xmin, ymin, xmax, ymax], [xmin, ymin] is the left top coordinate of the anchor box, if the input is image feature map, they are close to the origin of the coordinate system. [xmax, ymax] is the right bottom coordinate of the anchor box.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "PriorBoxVar",
   "comment" : "(Tensor, default Tensor<float>) PriorBoxVar is a 2-D Tensor with shape [M, 4] holds M group of variance.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "TargetBox",
   "comment" : "(LoDTensor or Tensor) this input is a 2-D LoDTensor with shape [N, 4], each box is represented as [xmin, ymin, xmax, ymax], [xmin, ymin] is the left top coordinate of the box if the input is image feature map, they are close to the origin of the coordinate system. [xmax, ymax] is the right bottom coordinate of the box. This tensor can contain LoD information to represent a batch of inputs. One instance of this batch can contain different numbers of entities.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "OutputBox",
   "comment" : "(LoDTensor or Tensor) (Tensor) The output of box_coder_op, a tensor with shape [N, M, 4] representing the result of N target boxes encoded/decoded with M Prior boxes and variances.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "code_type",
   "type" : "string",
   "comment" : "(string, default encode_center_size) the code type used with the target box",
   "generated" : 0
 } ] 
5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799
},{
 "type" : "bipartite_match",
 "comment" : "\nThis operator is a greedy bipartite matching algorithm, which is used to\nobtain the matching with the maximum distance based on the input\ndistance matrix. For input 2D matrix, the bipartite matching algorithm can\nfind the matched column for each row, also can find the matched row for\neach column. And this operator only calculate matched indices from column\nto row. For each instance, the number of matched indices is the number of\nof columns of the input ditance matrix.\n\nThere are two outputs to save matched indices and distance.\nA simple description, this algothrim matched the best (maximum distance)\nrow entity to the column entity and the matched indices are not duplicated\nin each row of ColToRowMatchIndices. If the column entity is not matched\nany row entity, set -1 in ColToRowMatchIndices.\n\nPlease note that the input DistMat can be LoDTensor (with LoD) or Tensor.\nIf LoDTensor with LoD, the height of ColToRowMatchIndices is batch size.\nIf Tensor, the height of ColToRowMatchIndices is 1.\n\n",
 "inputs" : [ 
 { 
   "name" : "DistMat",
   "comment" : "(LoDTensor or Tensor) this input is a 2-D LoDTensor with shape [K, M]. It is pair-wise distance matrix between the entities represented by each row and each column. For example, assumed one entity is A with shape [K], another entity is B with shape [M]. The DistMat[i][j] is the distance between A[i] and B[j]. The bigger the distance is, the better macthing the pairs are. Please note, This tensor can contain LoD information to represent a batch of inputs. One instance of this batch can contain different numbers of entities.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "ColToRowMatchIndices",
   "comment" : "(Tensor) A 2-D Tensor with shape [N, M] in int type. N is the batch size. If ColToRowMatchIndices[i][j] is -1, it means B[j] does not match any entity in i-th instance. Otherwise, it means B[j] is matched to row ColToRowMatchIndices[i][j] in i-th instance. The row number of i-th instance is saved in ColToRowMatchIndices[i][j].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5800 5801
   "name" : "ColToRowMatchDist",
   "comment" : "(Tensor) A 2-D Tensor with shape [N, M] in float type. N is batch size. If ColToRowMatchIndices[i][j] is -1, ColToRowMatchDist[i][j] is also -1.0. Otherwise, assumed ColToRowMatchIndices[i][j] = d, and the row offsets of each instance are called LoD. Then ColToRowMatchDist[i][j] = DistMat[d+LoD[i]][j]",
5802 5803 5804
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5805 5806
 "attrs" : [  ] 
},{
5807 5808
 "type" : "batch_norm",
 "comment" : "\nBatch Normalization.\n\nBatch Norm has been implemented as discussed in the paper:\nhttps://arxiv.org/pdf/1502.03167.pdf\nCan be used as a normalizer function for conv2d and fully_connected operations.\nThe required data format for this layer is one of the following:\n1. NHWC `[batch, in_height, in_width, in_channels]`\n2. NCHW `[batch, in_channels, in_height, in_width]`\n\n",
5809 5810 5811
 "inputs" : [ 
 { 
   "name" : "X",
5812
   "comment" : "The input tensor",
5813 5814
   "duplicable" : 0,
   "intermediate" : 0
5815 5816 5817 5818
 }, { 
   "name" : "Scale",
   "comment" : "Scale is a 1-dimensional tensor of size C that is applied to the output",
   "duplicable" : 0,
5819 5820
   "intermediate" : 0
 }, { 
5821 5822 5823 5824
   "name" : "Bias",
   "comment" : "Bias is a 1-dimensional tensor of size C that is applied to the output",
   "duplicable" : 0,
   "intermediate" : 0
5825
 }, { 
5826 5827
   "name" : "Mean",
   "comment" : "The global mean (for training) or estimated mean (for testing)",
5828 5829 5830
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5831 5832
   "name" : "Variance",
   "comment" : "The global variance (for training) or estimated Variance (for testing)",
5833 5834 5835 5836 5837
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5838 5839
   "name" : "Y",
   "comment" : "result after normalization",
5840 5841 5842
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5843 5844
   "name" : "MeanOut",
   "comment" : "Share memory with Mean. Store the global mean when training",
5845 5846 5847
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
5848 5849
   "name" : "VarianceOut",
   "comment" : "Share memory with Variance. Store the global Variance when training",
5850 5851
   "duplicable" : 0,
   "intermediate" : 0
5852 5853 5854 5855 5856 5857 5858 5859 5860 5861
 }, { 
   "name" : "SavedMean",
   "comment" : "Mean of the current mini batch, will apply to output when training",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "SavedVariance",
   "comment" : "Variance of the current mini batch, will apply to output when training",
   "duplicable" : 0,
   "intermediate" : 1
5862 5863 5864
 } ], 
 "attrs" : [ 
 { 
5865 5866 5867
   "name" : "is_test",
   "type" : "bool",
   "comment" : "",
5868 5869
   "generated" : 0
 }, { 
5870 5871 5872
   "name" : "momentum",
   "type" : "float",
   "comment" : "",
5873 5874
   "generated" : 0
 }, { 
5875 5876 5877 5878 5879
   "name" : "epsilon",
   "type" : "float",
   "comment" : "",
   "generated" : 0
 }, { 
5880
   "name" : "data_layout",
5881 5882
   "type" : "string",
   "comment" : "",
5883 5884 5885
   "generated" : 0
 } ] 
},{
5886 5887
 "type" : "auc",
 "comment" : "\nArea Under The Curve (AUC) Operator.\n\nThis implementation computes the AUC according to forward output and label.\nIt is used very widely in binary classification evaluation. As a note:\nIf input label contains values other than 0 and 1, it will be cast\nto bool. You can find the relevant definitions here:\nhttps://en.wikipedia.org/wiki/Receiver_operating_characteristic#Area_under_the_curve\n\nThere are two types of possible curves:\n1. ROC: Receiver operating characteristic\n2. PR: Precision Recall\n",
5888 5889
 "inputs" : [ 
 { 
5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901
   "name" : "Out",
   "comment" : "A floating point 2D tensor, values are in the range [0, 1].Each row is sorted in descending order. This input should be theoutput of topk.Typically, this tensor indicates the probability of each label",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Indices",
   "comment" : "An int 2D tensor, indicating the indices of originaltensor before sorting. Typically, this tensor indicates which label the probability stands for.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "A 2D int tensor indicating the label of the training data.The height is batch size and width is always 1.",
5902 5903 5904 5905 5906
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
5907 5908
   "name" : "AUC",
   "comment" : "A scalar representing the current area-under-the-curve.",
5909 5910 5911
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923
 "attrs" : [ 
 { 
   "name" : "curve",
   "type" : "string",
   "comment" : "Curve type, can be 'ROC' or 'PR'.",
   "generated" : 0
 }, { 
   "name" : "num_thresholds",
   "type" : "int",
   "comment" : "The number of thresholds to use when discretizing the roc curve.",
   "generated" : 0
 } ] 
5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956
},{
 "type" : "assign_value",
 "comment" : "\nAssignValue operator\n\n$$Out = values$$\n",
 "inputs" : [  ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(Tensor) Output tensor of assign_value operator.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "shape",
   "type" : "int array",
   "comment" : "(vector<int>) Shape of values.",
   "generated" : 0
 }, { 
   "name" : "dtype",
   "type" : "int",
   "comment" : "data type of values",
   "generated" : 0
 }, { 
   "name" : "fp32_values",
   "type" : "float array",
   "comment" : "store the float values",
   "generated" : 0
 }, { 
   "name" : "int32_values",
   "type" : "int array",
   "comment" : "store the int values",
   "generated" : 0
 } ] 
5957
},{
5958 5959
 "type" : "split",
 "comment" : "\nSplit operator\n\nThis operator splits the input tensor into multiple sub-tensors.\n\nExample:\n  Input = [[1,2],\n           [3,4],\n           [5,6]]\n  sections = [2,1]\n  axis = 0\n  Output[0] = [[1,2],\n               [3,4]]\n  Output[1] = [[5,6]]\n\n    ",
5960 5961 5962
 "inputs" : [ 
 { 
   "name" : "X",
5963
   "comment" : "(Tensor) Input tensor of the split operator.",
5964 5965 5966 5967 5968 5969
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
5970
   "comment" : "(Tensor) Output tensors of the split operator.",
5971 5972 5973 5974 5975
   "duplicable" : 1,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
5976 5977 5978
   "name" : "sections",
   "type" : "int array",
   "comment" : "(vector<int>) the length of each output along the specified axis.",
5979 5980
   "generated" : 0
 }, { 
5981 5982 5983
   "name" : "num",
   "type" : "int",
   "comment" : "(int, default 0)Number of sub-tensors. This must evenly divide Input.dims()[axis]",
5984 5985
   "generated" : 0
 }, { 
5986 5987 5988
   "name" : "axis",
   "type" : "int",
   "comment" : "(int, default 0) The axis which the input will be splited on.",
5989 5990 5991
   "generated" : 0
 } ] 
},{
5992 5993
 "type" : "beam_search_decode",
 "comment" : "\nPack the result of Beam search op into SentenceIds and SentenceScores.\n",
5994 5995
 "inputs" : [ 
 { 
5996 5997
   "name" : "Ids",
   "comment" : "(LodTensorArray)score of the candidate words in each step",
5998 5999 6000
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6001 6002
   "name" : "Scores",
   "comment" : "(LodTensorArray)score of the candidate words in each step",
6003 6004 6005 6006 6007
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6008 6009
   "name" : "SentenceIds",
   "comment" : "(LodTensor)All possible result sentences of word ids",
6010 6011 6012
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6013 6014
   "name" : "SentenceScores",
   "comment" : "(LodTensor)All possible result sentences of word scores",
6015
   "duplicable" : 0,
6016
   "intermediate" : 0
6017 6018 6019
 } ], 
 "attrs" : [  ] 
},{
6020 6021
 "type" : "assign",
 "comment" : "Assign Operator\n\nOut = X,  when type in [LoDTensor/SelectedRows/LoDTensorArray]\nraise error if the type is not listed above.\n",
6022 6023
 "inputs" : [ 
 { 
6024 6025
   "name" : "X",
   "comment" : "(LoDTensor, SelectedRows or LoDTensorArray) The input variable could be LoDTensor, SelectedRows or LoDTensorArray.",
6026 6027 6028 6029 6030
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6031 6032
   "name" : "Out",
   "comment" : "(LoDTensor, SelectedRows or LoDTensorArray) The type of output is the same as input X.",
6033 6034
   "duplicable" : 0,
   "intermediate" : 0
6035 6036
 } ], 
 "attrs" : [  ] 
6037
},{
6038 6039
 "type" : "adadelta",
 "comment" : "\nAdadelta Optimizer.\n\nAdadelta optimizer is implemented as explained in:\nhttps://arxiv.org/abs/1212.5701\nAdadelta is a per-dimension adaptive learning rate method used\nfor gradient descent.\n\nAdadelta updates are as follows:\n\n$$\navg\\_squared\\_grad\\_out = \\rho * avg\\_squared\\_grad + (1 - \\rho) * grad * grad \\\\\nparam\\_update =  - \\sqrt{\\frac{avg\\_squared\\_update + \\epsilon}{avg\\_squared\\_grad\\_out + \\epsilon}} * grad \\\\\navg\\_squared\\_update\\_out = \\rho * avg\\_squared\\_update + (1 - \\rho) * {param\\_update}^2 \\\\\nparam\\_out = param + param\\_update\n$$\n\n",
6040 6041
 "inputs" : [ 
 { 
6042 6043
   "name" : "Param",
   "comment" : "(Tensor) Input parameter",
6044 6045 6046
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6047 6048
   "name" : "Grad",
   "comment" : "(Tensor) Input gradient",
6049 6050 6051
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6052 6053
   "name" : "AvgSquaredGrad",
   "comment" : "(Tensor) Input average of squared gradient",
6054 6055 6056
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6057 6058
   "name" : "AvgSquaredUpdate",
   "comment" : "(Tensor) Input average of squared parameter updates",
6059 6060 6061 6062 6063
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6064 6065
   "name" : "ParamOut",
   "comment" : "(Tensor) Output parameter",
6066 6067 6068
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6069 6070
   "name" : "AvgSquaredGradOut",
   "comment" : "(Tensor) Output average of squared gradient",
6071 6072 6073
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
6074 6075
   "name" : "AvgSquaredUpdateOut",
   "comment" : "(Tensor) Output average of squared parameter updates",
6076 6077 6078
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090
 "attrs" : [ 
 { 
   "name" : "rho",
   "type" : "float",
   "comment" : "(float, default 0.95) Exponential decay rate for squared gradients.",
   "generated" : 0
 }, { 
   "name" : "epsilon",
   "type" : "float",
   "comment" : "(float, default 1.0e-6) Constant for numerical stability",
   "generated" : 0
 } ] 
6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199
},{
 "type" : "nce",
 "comment" : "\nCompute and return the noise-contrastive estimation training loss.\nSee [Noise-contrastive estimation: A new estimation principle for unnormalized statistical models](http://www.jmlr.org/proceedings/papers/v9/gutmann10a/gutmann10a.pdf).\nBy default this operator uses a uniform distribution for sampling.\n",
 "inputs" : [ 
 { 
   "name" : "Input",
   "comment" : "(Tensor) A tensor of shape [batch_size, dim].",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(Tensor) A tensor of shape [batch_size, num_true_class]. 'num_true_class' is the number of target classes in each sample.The number of target classes per sample should be same. If you have a variable number of target classes, you can pad them out to a constant number by either repeating them or by padding with an otherwise unused class.)",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Weight",
   "comment" : "(Tensor) A tensor of shape [num_class, dim]. 'num_class' is the total number of class.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Bias",
   "comment" : "(Tensor) A tensor of shape [num_class, 1]. 'num_class' is the total number of class. It is a dispensable input.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "SampleWeight",
   "comment" : "(Tensor) A tensor of shape [batch_size, 1] storing a weight for each sample. And it is a dispensable input. The default value of sample is 1.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Cost",
   "comment" : "(Tensor) A tensor of shape [batch_size, 1]. Cost of samples.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "SampleLogits",
   "comment" : "An intermediate tensor of shape[batch_size, num_neg_samples + num_pos_samples].This tensor is output of forward kernel and used in backward kernel to compute grads.Given X is  the dot product of input tensor and sampled labels' weights.Then 'SampleLogits' is sigmoid(X).",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "SampleLabels",
   "comment" : "An intermediate tensor of shape[batch_size, num_neg_samples + num_pos_samples].This tensor is output of forward kernel and used in backward kernel to compute grads.",
   "duplicable" : 0,
   "intermediate" : 1
 } ], 
 "attrs" : [ 
 { 
   "name" : "num_total_classes",
   "type" : "int",
   "comment" : "Total number of classes in all samples.",
   "generated" : 0
 }, { 
   "name" : "num_neg_samples",
   "type" : "int",
   "comment" : "The number of negative classes. The default value is 10.",
   "generated" : 0
 }, { 
   "name" : "custom_neg_classes",
   "type" : "int array",
   "comment" : "This attribute only be used in unitest. Classes in this list wiil be used as negative classes for every samples. Under normal conditions, user should avoid setting this attribute.",
   "generated" : 0
 } ] 
},{
 "type" : "linear_chain_crf",
 "comment" : "\nLinearChainCRF Operator.\n\nConditional Random Field defines an undirected probabilistic graph with nodes\ndenoting random variables and edges denoting dependencies between these\nvariables. CRF learns the conditional probability $P(Y|X)$, where\n$X = (x_1, x_2, ... , x_n)$ are structured inputs and\n$Y = (y_1, y_2, ... , y_n)$ are labels for the inputs.\n\nLinear chain CRF is a special case of CRF that is useful for sequence labeling\ntask. Sequence labeling tasks do not assume a lot of conditional\nindependences among inputs. The only constraint they impose is that the input\nand output must be linear sequences. Thus, the graph of such a CRF is a simple\nchain or a line, which results in the linear chain CRF.\n\nThis operator implements the Forward-Backward algorithm for the linear chain\nCRF. Please refer to http://www.cs.columbia.edu/~mcollins/fb.pdf and\nhttp://cseweb.ucsd.edu/~elkan/250Bwinter2012/loglinearCRFs.pdf for details.\n\nEquation:\n1. Denote Input(Emission) to this operator as $x$ here.\n2. The first D values of Input(Transition) to this operator are for starting\nweights, denoted as $a$ here.\n3. The next D values of Input(Transition) of this operator are for ending\nweights, denoted as $b$ here.\n4. The remaning values of Input(Transition) are for transition weights,\ndenoted as $w$ here.\n5. Denote Input(Label) as $s$ here.\n\nThe probability of a sequence $s$ of length $L$ is defined as:\n$$P(s) = (1/Z) \\exp(a_{s_1} + b_{s_L}\n                + \\sum_{l=1}^L x_{s_l}\n                + \\sum_{l=2}^L w_{s_{l-1},s_l})$$\n\nwhere $Z$ is a normalization value so that the sum of $P(s)$ over\nall possible sequences is 1, and $x$ is the emission feature weight\nto the linear chain CRF.\n\nFinally, the linear chain CRF operator outputs the logarithm of the conditional\nlikelihood of each training sample in a mini-batch.\n\nNOTE:\n1. The feature function for a CRF is made up of the emission features and the\ntransition features. The emission feature weights are NOT computed in\nthis operator. They MUST be computed first before this operator is called.\n\n2. Because this operator performs global normalization over all possible\nsequences internally, it expects UNSCALED emission feature weights.\nPlease do not call this op with the emission feature being output of any\nnonlinear activation.\n\n3. The 2nd dimension of Input(Emission) MUST be equal to the tag number.\n\n",
 "inputs" : [ 
 { 
   "name" : "Emission",
   "comment" : "(LoDTensor, default LoDTensor<float>) A 2-D LoDTensor with shape [N x D], where N is the size of the mini-batch and D is the total tag number. The unscaled emission weight matrix for the linear chain CRF. ",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Transition",
   "comment" : "(Tensor, default Tensor<float>) A 2-D Tensor with shape [(D + 2) x D]. The learnable parameter for the linear_chain_crf operator. See more details in the operator's comments.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Label",
   "comment" : "(LoDTensor, default LoDTensor<int64_t>) A LoDTensor with shape [N x 1], where N is the total element number in a mini-batch. The ground truth.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Alpha",
   "comment" : "(Tensor, default Tensor<float>) A 2-D Tensor with shape [N x D]. The forward vectors for the entire batch. Denote it as $lpha$. $lpha$ is a memo table used to calculate the normalization factor in CRF. $lpha[k, v]$ stores the unnormalized probabilites of all possible unfinished sequences of tags that end at position $k$ with tag $v$. For each $k$, $lpha[k, v]$ is a vector of length $D$ with a component for each tag value $v$. This vector is called a forward vecotr and will also be used in backward computations.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "EmissionExps",
   "comment" : "(Tensor, default Tensor<float>) A 2-D Tensor with shape [N x D]. The exponentials of Input(Emission). This is an intermediate computational result in forward computation, and will be reused in backward computation.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "TransitionExps",
   "comment" : "(Tensor, default Tensor<float>) A 2-D Tensor with shape [(D + 2) x D]. The exponentials of Input(Transition). This is an intermediate computational result in forward computation, and will be reused in backward computation.",
   "duplicable" : 0,
   "intermediate" : 1
 }, { 
   "name" : "LogLikelihood",
   "comment" : "(Tensor, default Tensor<float>) The logarithm of the conditional likelihood of each training sample in a mini-batch. This is a 2-D tensor with shape [S x 1], where S is the sequence number in a mini-batch. Note: S is equal to the sequence number in a mini-batch. The output is no longer a LoDTensor.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "logsigmoid",
6200
 "comment" : "\nLogsigmoid Activation Operator\n\n$$out = \\log \\frac{1}{1 + e^{-x}}$$\n\n",
6201 6202 6203 6204 6205 6206 6207 6208 6209
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of LogSigmoid operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6210
   "name" : "Out",
6211 6212 6213 6214 6215
   "comment" : "Output of LogSigmoid operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238
},{
 "type" : "row_conv",
 "comment" : "\nRow-convolution Operator.\n\nThe row convolution is called lookahead convolution.  This operator was \nintroduced in the following paper for DeepSpeech2:\nhttp://www.cs.cmu.edu/~dyogatam/papers/wang+etal.iclrworkshop2016.pdf \n\nThe main motivation is that a bidirectional RNN, useful in DeepSpeech \nlike speech models, learns representation for a sequence by performing a \nforward and a backward pass through the entire sequence. However, unlike \nunidirectional RNNs, bidirectional RNNs are challenging to deploy in an online\nand low-latency setting. The lookahead convolution incorporates information \nfrom future subsequences in a computationally efficient manner to improve \nunidirectional recurrent neural networks. The row convolution operator is \ndifferent from the 1D sequence convolution, and is computed as follows:\n\nGiven an input sequence $in$ of length $t$ and input dimension $d$, \nand a filter ($W$) of size $context \\times d$, \nthe output sequence is convolved as:\n\n$$\nout_{i, :} = \\sum_{j=i}^{i + context} in_{j,:} \\dot W_{i-j, :}\n$$\n\n",
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "(LoDTensor), the input(X) is a LodTensor, which supports variable time-length input sequences. The underlying tensor in this LoDTensor is a matrix with shape (T x N), where T is the total time steps in this mini-batch and N is the input data dimension.",
   "duplicable" : 0,
   "intermediate" : 0
 }, { 
   "name" : "Filter",
   "comment" : "(Tensor), the input(Filter) is a learnable parameter. It is a 2-D tensor with shape (future_context x N), where, future_context is the future context length and N is the data dimension.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
   "name" : "Out",
   "comment" : "(LoDTensor), the output(Out) is a LodTensor, which supports variable time-length input sequences. The underlying tensor in this LodTensor is a matrix with shape T x N, i.e., the same shape as X.",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
6239 6240
},{
 "type" : "exp",
6241
 "comment" : "\nExp Activation Operator.\n\n$out = e^x$\n\n",
6242 6243 6244 6245 6246 6247 6248 6249 6250
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Exp operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6251
   "name" : "Out",
6252 6253 6254 6255 6256 6257 6258
   "comment" : "Output of Exp operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [  ] 
},{
 "type" : "soft_relu",
6259
 "comment" : "\nSoftRelu Activation Operator.\n\n$out = \\ln(1 + \\exp(\\max(\\min(x, threshold), threshold))$\n\n",
6260 6261 6262 6263 6264 6265 6266 6267 6268
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of SoftRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6269
   "name" : "Out",
6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282
   "comment" : "Output of SoftRelu operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "threshold",
   "type" : "float",
   "comment" : "The threshold value of SoftRelu",
   "generated" : 0
 } ] 
},{
 "type" : "softshrink",
6283
 "comment" : "\nSoftshrink Activation Operator.\n\n$$\nout = \\begin{cases} \n    x - \\lambda, \\text{if } x > \\lambda \\\\\n    x + \\lambda, \\text{if } x < -\\lambda \\\\\n    0,  \\text{otherwise}\n    \\end{cases}\n$$\n\n",
6284 6285 6286 6287 6288 6289 6290 6291 6292
 "inputs" : [ 
 { 
   "name" : "X",
   "comment" : "Input of Softshrink operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "outputs" : [ 
 { 
6293
   "name" : "Out",
6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305
   "comment" : "Output of Softshrink operator",
   "duplicable" : 0,
   "intermediate" : 0
 } ], 
 "attrs" : [ 
 { 
   "name" : "lambda",
   "type" : "float",
   "comment" : "non-negative offset",
   "generated" : 0
 } ] 
}]