xidulu commented on a change in pull request #17084: [numpy] add op median
URL: https://github.com/apache/incubator-mxnet/pull/17084#discussion_r358095426
##########
File path: src/operator/numpy/np_broadcast_reduce_op_value.cc
##########
@@ -320,6 +321,37 @@ NNVM_REGISTER_OP(_backward_np_average)
return std::vector<ResourceRequest>{ResourceRequest::kTempSpace};
});
+inline bool NumpyMedianType(const nnvm::NodeAttrs& attrs,
+ std::vector<int> *in_attrs,
+ std::vector<int> *out_attrs) {
+ CHECK_EQ(in_attrs->size(), 1U);
+ CHECK_EQ(out_attrs->size(), 1U);
+
+ TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(0));
Review comment:
The type for output should `float32` by default (or floating number of other
precisions), instead of being inferred from the input.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services