zixuanweeei commented on a change in pull request #17959: [MKLDNN] Add LSTMP to 
v1.6.x
URL: https://github.com/apache/incubator-mxnet/pull/17959#discussion_r403419699
 
 

 ##########
 File path: src/operator/rnn_impl.h
 ##########
 @@ -248,14 +258,26 @@ void LstmForwardInferenceSingleLayer(DType* ws,
       DType ot = sigmoid<DType>(yx[t][j][3][k] + yh[j][3][k] + bx[3][k] + 
bh[3][k]);
       DType ct = (i ? c[j][k] : cx[j][k]) * ft + it * gt;
       DType ht = ot * tanh(ct);
-      y[t][j][k + offset] = ht;
+      if (P == 0) y[t][j][k + offset] = ht;
       if (i == T - 1 && state_outputs) {
-        hy_ptr[jk] = ht;
+        if (P == 0) hy_ptr[jk] = ht;
         cy_ptr[jk] = ct;
       } else {
-        h[j][k] = ht;
         c[j][k] = ct;
       }
+      h[j][k] = ht;
+    }
+    if (P > 0) {
+      linalg_gemm(h, whr, r, alpha, beta, false, true);
+#pragma GCC diagnostic push
+#if __GNUC__ >= 8
 
 Review comment:
   It was added by #17752 to fix cpu gcc8 -WError build. I forget to remove 
these lines. Maybe we can just drop them, right?

----------------------------------------------------------------
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

Reply via email to