jinhuang415 commented on a change in pull request #10433: [MXNET-290] MKLDNN
support for model quantization
URL: https://github.com/apache/incubator-mxnet/pull/10433#discussion_r190488062
##########
File path: src/operator/quantization/quantized_flatten-inl.h
##########
@@ -62,11 +62,21 @@ void QuantizedFlattenCompute(const nnvm::NodeAttrs& attrs,
using namespace mxnet_op;
Stream<xpu> *s = ctx.get_stream<xpu>();
- typedef int8_t DstDType;
- typedef int8_t SrcDType;
- Kernel<quantized_flatten, xpu>::Launch(s, outputs[0].Size(),
- outputs[0].dptr<DstDType>(), outputs[1].dptr<float>(),
outputs[2].dptr<float>(),
- inputs[0].dptr<SrcDType>(), inputs[1].dptr<float>(),
inputs[2].dptr<float>());
+ if (inputs[0].type_flag_ == mshadow::kUint8) {
Review comment:
Looks the kernel already have a SrcDtype/DstDtype template argument, the
reason for the duplication is due to the SrcDtype/DstDtype is different from
inputs[0].type_flag_ so we need a mapping in order to define SrcDtype/DstDtype,
since the define is within if condition branch and has local scope so we need
to call Kernel<>::launch twice in if condition.
----------------------------------------------------------------
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