How to define a model inside a class?

I modify some layers and I want to create a class for them. For example,

class mod:
    class linear(nn.Module):
       def __init__(self, d_int, d_out):
           pass
       def forward(self, x):
           pass

When I try to initialize this layer by

layer = mod.linear(2, 3)

I get an error saying

super(type, obj): obj must be an instance or subtype of type

Is there anyway to solve this problem?