singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] nudles commented on a change in pull request #586: Add GlobalAVGPool operator for autograd and onnx
Date Thu, 30 Jan 2020 13:44:34 GMT
nudles commented on a change in pull request #586: Add GlobalAVGPool operator for autograd
and onnx
URL: https://github.com/apache/singa/pull/586#discussion_r372954319
 
 

 ##########
 File path: python/singa/autograd.py
 ##########
 @@ -2760,3 +2760,42 @@ def backward(self, dy):
 
 def reciprocal(x):
     return Reciprocal()(x)[0]
+
+
+class GlobalAveragePool(Operation):
+    def __init__(self, data_format='channels_first'):
+        super(GlobalAveragePool, self).__init__()
+        self.data_format = data_format
+
+    def forward(self, x):
+        if training:
+            self.mask = singa.Tensor(list(x.shape()), x.device())
 
 Review comment:
   can remove list()?

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

Mime
View raw message