You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:35:17 UTC

[GitHub] [incubator-mxnet] szha commented on a change in pull request #17196: [NumPy] loss for np array

szha commented on a change in pull request #17196:
URL: https://github.com/apache/incubator-mxnet/pull/17196#discussion_r461311742



##########
File path: python/mxnet/gluon/loss.py
##########
@@ -74,6 +74,26 @@ def _reshape_like(F, x, y):
     return F.reshape_like(x, y)
 
 
+def _batch_mean(F, loss, batch_axis):
+    """Return mean on the specified batch axis, not keeping the axis"""
+    if is_np_array():
+        axes = list(range(loss.ndim))

Review comment:
       it won't with the current hybridization approach. it will once we fully switch to deferred compute.




----------------------------------------------------------------
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:
users@infra.apache.org