eric-haibin-lin commented on a change in pull request #12749: [MXNET-1029]
Feature request: randint operator
URL: https://github.com/apache/incubator-mxnet/pull/12749#discussion_r230529316
##########
File path: src/operator/random/sample_op.h
##########
@@ -474,6 +503,25 @@ static inline void gen_neg_binomial_op(const
nnvm::NodeAttrs& attrs,
});
}
+template<typename xpu, typename ParamType>
+static inline void rand_int_op(const nnvm::NodeAttrs& attrs,
+ const OpContext& ctx,
+ const OpReqType& req,
+ TBlob* outputs) {
+ Stream<xpu> *s = ctx.get_stream<xpu>();
+ const SampleRandIntParam& param =
nnvm::get<SampleRandIntParam>(attrs.parsed);
+ CHECK_GE(param.high, param.low) << "low must be less or equal to high in
uniform distribution";
+ Tensor<xpu, 1, int> low, high;
Review comment:
Is it hard coded with int32?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services