Subclassing nn.Linear

This seems a really stupid question but I am having trouble subclassing nn.Linear in 0.40

class CustomLinear(nn.Linear):
    def __init__(self, in_features, out_features):
        super(nn.Linear, self).__init__(in_features, out_features, True)

Whenever I call my own constructor I get an error saying init() takes 1 positional argument but 4 were given.

CustomLinear.CustomLinear(640, fc_hidden_size)

Any ideas?

should be super(CustomLinear, self)

Thanks SimonW, but how can I call the other constructor of Linear i.e. the one with the following signature:

 def __init__(self, in_features, out_features, bias=True):

yes, that calls it.

super(CustomLinear, self) is viewing self as super of CustomLinear, that is nn.Linear

Oh sorry I see what you are saying now. Thanks !!