reminisce commented on a change in pull request #9700: Squeeze op URL: https://github.com/apache/incubator-mxnet/pull/9700#discussion_r166396108
########## File path: src/operator/tensor/matrix_op.cc ########## @@ -739,5 +740,43 @@ NNVM_REGISTER_OP(_backward_stack) .set_attr<nnvm::TIsBackward>("TIsBackward", true) .set_attr<FCompute>("FCompute<cpu>", StackOpBackward<cpu>); +NNVM_REGISTER_OP(squeeze) +.describe(R"code(Remove single-dimensional entries from the shape of an array. +Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases. +See the following note for exception. + +Examples:: + + data = [[[0], [1], [2]]] + squeeze(data) = [0, 1, 2] + squeeze(data, axis=0) = [[0], [1], [2]] + squeeze(data, axis=2) = [[0, 1, 2]] + squeeze(data, axis=(0, 2)) = [0, 1, 2] + +.. Note:: + The output of this operator will keep at least one dimension not removed. For example, + squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar. +)code") +.set_num_inputs(1) +.set_num_outputs(1) +.set_attr_parser(ParamParser<SqueezeParam>) +.set_attr<nnvm::FListInputNames>("FListInputNames", + [](const NodeAttrs& attrs) { + return std::vector<std::string>{"data"}; + }) +.set_attr<nnvm::FInferShape>("FInferShape", SqueezeShape) +.set_attr<nnvm::FInferType>("FInferType", ElemwiseType<1, 1>) +.set_attr<FCompute>("FCompute<cpu>", SqueezeCompute<cpu>) Review comment: You are right. Changed now. Thanks. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services