haojin2 commented on a change in pull request #17904: [Numpy] add: numpy op trilindices URL: https://github.com/apache/incubator-mxnet/pull/17904#discussion_r405196183
########## File path: src/operator/numpy/np_matrix_op.cc ########## @@ -1115,6 +1115,66 @@ NNVM_REGISTER_OP(_backward_np_dstack) .set_attr<nnvm::TIsBackward>("TIsBackward", true) .set_attr<FCompute>("FCompute<cpu>", DStackGradCompute<cpu>); +DMLC_REGISTER_PARAMETER(NumpyTrilindicesParam); + +inline bool TrilindicesOpType(const nnvm::NodeAttrs& attrs, + std::vector<int> *in_attrs, + std::vector<int> *out_attrs) { + CHECK_EQ(in_attrs->size(), 0U); + CHECK_EQ(out_attrs->size(), 2U); + + TYPE_ASSIGN_CHECK(*out_attrs, 0, mshadow::kInt64); + TYPE_ASSIGN_CHECK(*out_attrs, 1, mshadow::kInt64); + + return true; +} + +inline bool TrilindicesOpShape(const nnvm::NodeAttrs& attrs, + mxnet::ShapeVector* in_attrs, + mxnet::ShapeVector* out_attrs) { + CHECK_EQ(in_attrs->size(), 0U); + CHECK_EQ(out_attrs->size(), 2U); + + const NumpyTrilindicesParam& param = + nnvm::get<NumpyTrilindicesParam>(attrs.parsed); Review comment: ```c++ const NumpyTrilindicesParam& param = nnvm::get<NumpyTrilindicesParam>(attrs.parsed); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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