def __init()__和super().__init__()

class test(nn.Module):
  def __init__(self,name):
    super(test,self).__init__()
    self.name = name
  def forward(self,x):
    return str(x)+self.name
net = test("lrs")
print(net(12))

 

posted @ 2021-11-12 09:44  寻找烟花  阅读(280)  评论(0编辑  收藏  举报