import torch
import torch.nn as nn
def test_pytorch():
# 创建一个简单的线性层
linear = nn.Linear(10, 5)
# 创建一个随机数据张量,用于模型输入
inputs = torch.randn(1, 10)
# 执行前向传递
outputs = linear(inputs)
print("Outputs of the linear layer:", outputs)
if __name__ == "__main__":
test_pytorch()