zixuanweeei commented on a change in pull request #17702: Support projection
feature for LSTM on CPU (Only Inference)
URL: https://github.com/apache/incubator-mxnet/pull/17702#discussion_r386069714
##########
File path: src/operator/rnn_impl.h
##########
@@ -219,7 +220,10 @@ void LstmForwardInferenceSingleLayer(DType* ws,
DType* cy_ptr) {
using namespace mshadow;
const Tensor<cpu, 2, DType> wx(w_ptr, Shape2(H * 4, I));
- const Tensor<cpu, 2, DType> wh(w_ptr + I * H * 4, Shape2(H * 4, H));
+ const Tensor<cpu, 2, DType> wh(w_ptr + I * H * 4, Shape2(H * 4, (P ? P :
H)));
+ Tensor<cpu, 2, DType> whr(w_ptr, Shape2(1, 1));
+ if (P > 0)
+ whr = Tensor<cpu, 2, DType>(wh.dptr_ + P * 4 * H, Shape2(P, H));
Review comment:
Put them into the same line, as well as L236.
----------------------------------------------------------------
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