Sorry I am not really good with anything autograd-related … You’ll have to wait for someone else to answer.
(Maybe the case when bias==False is not properly handled somewhere?
But I don’t really see where self.weight and self.bias are used, in your code)