mseth10 commented on a change in pull request #12884: adding unittest for 
MKLDNN Softmax operator
URL: https://github.com/apache/incubator-mxnet/pull/12884#discussion_r234811732
 
 

 ##########
 File path: tests/cpp/operator/mkldnn_operator_test.cc
 ##########
 @@ -558,31 +607,41 @@ void TestOpEx(const OpAttrs &forward_attrs, const 
OpAttrs &backwards_attrs) {
         Engine::Get()->WaitForAll();
         AssertEqual(outputs, ex_outputs);
 
-        // backwards test performed same time since output needed
-        backwards_input[0] = outputs[0];  // output grad
-        backwards_input[1] = inputs[0];  // input
-        backwards_input[2] = outputs[1];  // out norm
+        if (!backwards_attrs.requests.empty()) {
+          TestOpExBackward(forward_attrs, backwards_attrs, OpReqType::kWriteTo,
 
 Review comment:
   This function TestOpEx is basically test forward which handles multiple 
request types like WriteTo and WriteInPlace. For some operators backward test 
needs to be performed for their specific request types. That is when test 
backwards is called, the inputs to which are the outputs of test forward. 
Hence, it's being called from within this function.

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

Reply via email to