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/02/21 16:15:25 UTC
[GitHub] [incubator-mxnet] MoisesHer commented on a change in pull request
#17652: Use multi-tensor sumSQ in clip_global_norm
MoisesHer commented on a change in pull request #17652: Use multi-tensor sumSQ in clip_global_norm
URL: https://github.com/apache/incubator-mxnet/pull/17652#discussion_r382671475
##########
File path: python/mxnet/gluon/utils.py
##########
@@ -145,12 +143,12 @@ def group_by_ctx(arr_list):
all_ctx_sum = []
ctx = arrays[0].context
for group in arrays_groups:
- sum_sq = mx.nd.multi_sum_sq(*arrays_groups[group],
- num_arrays=len(arrays_groups[group]))
- sum_sq = nd.add_n(*sum_sq)
+ sum_sq = ndarray.multi_sum_sq(*arrays_groups[group],
Review comment:
I think this is equivalent,
so I modified it to ndarray, since this was already imported for other functions in the file
----------------------------------------------------------------
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
With regards,
Apache Git Services