nudles commented on a change in pull request #475: SINGA-463 fixed separable conv2d URL: https://github.com/apache/incubator-singa/pull/475#discussion_r299799187
########## File path: python/singa/autograd.py ########## @@ -924,17 +924,14 @@ def __init__( ) self.W.gaussian(0.0, std) - if self.bias: - b_shape = (self.out_channels,) - self.b = Tensor(shape=b_shape, requires_grad=True, stores_grad=True) - self.b.set_value(0.0) - else: - # to keep consistency when to do forward. - self.b = None - # Tensor(data=CTensor([]), requires_grad=False, stores_grad=False) + b_shape = (self.out_channels,) + # forward method required bias variable to proceed (dummy b tensor) + self.b = Tensor(shape=b_shape, requires_grad=self.bias, stores_grad=self.bias) + self.b.set_value(0.0) Review comment: sometimes, the model is configured without using bias. ---------------------------------------------------------------- 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