添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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):
       def forward(self, x):

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?