apeforest commented on a change in pull request #15625: Minor refactor of fully
connected.
URL: https://github.com/apache/incubator-mxnet/pull/15625#discussion_r307594482
##########
File path: src/operator/nn/fully_connected-inl.h
##########
@@ -134,59 +159,52 @@ void FCBackward(const OpContext &ctx, const
FullyConnectedParam ¶m,
using namespace mshadow::expr;
// TODO(bing): check the BLAS Handle, be careful
// maybe need blas handle from context
- Stream<xpu> *s = ctx.get_stream<xpu>();
- const mxnet::TShape& ishape = in_data[fullc::kData].shape_;
- const mxnet::TShape& oshape = out_grad[fullc::kOut].shape_;
-
- Tensor<xpu, 2, DType> wmat = in_data[fullc::kWeight].get<xpu, 2, DType>(s);
- Tensor<xpu, 2, DType> data, grad, gdata;
+ Stream<xpu> *stream = ctx.get_stream<xpu>();
+ Tensor<xpu, 2, DType> wmat = in_data[fullc::kWeight].get<xpu, 2,
DType>(stream);
+ Tensor<xpu, 2, DType> x, y_grad, x_grad;
if (!param.flatten) {
- data = in_data[fullc::kData].get_with_shape<xpu, 2, DType>(
Review comment:
These variable names are used in many operators. Why refactor them?
----------------------------------------------------------------
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