class 名称与 super() 中的自我调用之间的区别

different between class name vs self calling in super()

是不是和class name NeuralNet 和 self 关键字在 super 调用中传递的意思一样 -
super(NeuralNet,self).__init__() # init super

这是示例中的代码片段:

class NeuralNet(nn.Module):
    def __init__(self, use_batch_norm, input_size=784, hidden_dim=256, output_size=10):
        """
        Creates a PyTorch net using the given parameters.
        """
        super(NeuralNet, self).__init__() # init super
        # continues code

考虑到你的问题,我诚恳但非常强烈地建议你做 完整 official Python tutorial.

不,NeuralNetself 不是一回事。第一个是NeuralNetclass,第二个是当前NeuralNet实例("current": 方法被调用的那一个).