import torch
import torch.nn as nn
import unittest# 创建一个简单的 Conv2d 层
conv_layer = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, stride=1, padding=1)
# input_tensor = torch.randn(1, 3, 5, 5)
input_tensor = torch.ones(1, 3, 5, 5)
# print("input_tensor:", input_tensor)
# 应用卷积操作
output_tensor = conv_layer(input_tensor)
print("output_tensor shape:", output_tensor.shape)
print("output_tensor:", output_tensor)