ShichengChen commented on a change in pull request #511: SINGA-474 squeeze operator URL: https://github.com/apache/incubator-singa/pull/511#discussion_r313831539
########## File path: python/singa/autograd.py ########## @@ -1583,6 +1583,33 @@ def backward(self, dy): return dx1, dx2 +class Squeeze(Operation): + def __init__(self,axis=-1): + super(Squeeze, self).__init__() + if(type(axis) is int): + self.axis=[axis] + else: + self.axis=axis + + + def forward(self, x): Review comment: I followed numpy before. axis=-1 means squeeze all dimensions which are equal to one. I just changed squeeze to onnx version. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services