Hi,could plz tell if i run these code in PC,when these code execute function 【forward】,actually i dont call function 【forward】】

import torch
from torch import nn

class MLP(nn.Module):
# 声明带有模型参数的层,这里声明了两个全连接层
def init(self, **kwargs):
# 调用MLP父类Module的构造函数来进行必要的初始化。这样在构造实例时还可以指定其他函数
# 参数,如“模型参数的访问、初始化和共享”一节将介绍的模型参数params
super(MLP, self).init(**kwargs)
self.lzw_hidden = nn.Linear(784, 256) # 隐藏层
self.lzw_act = nn.ReLU()
self.output = nn.Linear(256, 10) # 输出层

# 定义模型的前向计算,即如何根据输入x计算返回所需要的模型输出
def forward(self, x):
    a = self.lzw_act(self.lzw_hidden(x))
    return self.output(a)

print(“hello world”)

X = torch.rand(2, 784)
net = MLP()
print(net)
#print(net(X))
result = net(X)
print(X)
print(result)

Calling the MLP class which is a subclass of nn.Module will automatically call the forward function of it.(as nn.Module internally implements call in such a way)