CassiniXu commented on a change in pull request #19044:
URL: https://github.com/apache/incubator-mxnet/pull/19044#discussion_r479992514
##########
File path: src/operator/numpy/np_pad_op-inl.h
##########
@@ -720,20 +729,44 @@ void NumpyPadOpImpl(const TBlob& in_data,
template<typename xpu>
void NumpyPadOpBackImpl(const TBlob& in_data,
const TBlob& out_data,
+ index_t* ishape,
+ index_t* oshape,
index_t dsize,
+ const NumpyPadParam& param,
const std::vector<OpReqType>& req,
mxnet_op::Stream<xpu> *s) {
- using namespace mxnet_op;
- using namespace mshadow;
- MSHADOW_TYPE_SWITCH_WITH_BOOL(out_data.type_flag_, DType, {
- MXNET_ASSIGN_REQ_SWITCH(req[0], req_type, {
- Kernel<pad_grad<xpu, req_type>, xpu>::Launch(
- s, dsize, out_data.dptr<DType>(), in_data.dptr<DType>());
- });
- });
+ using namespace mxnet_op;
+ using namespace mshadow;
+ int mode = param.mode;
+ int ndim = in_data.ndim();
+ MXNET_NDIM_SWITCH(ndim, NDim, {
+ mshadow::Shape<NDim*2> width;
+ int dimcounter = 0;
+ index_t* odptr = reinterpret_cast<index_t*>(oshape);
Review comment:
Thanks. I am trying to avoid using 'reinterpret_cast'.
----------------------------------------------------------------
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]