import torch
from torch.nn import Module
from torchsummary import summary
class lrelu_conv_bn(Module):
def __init__(self):
super(lrelu_conv_bn,self).__init__()
self.conv = torch.nn.ConvTranspose2d(1,1,kernel_size=4,stride=2,padding=1,bias=False)
def forward(self,x):
x = self.conv(x)
return x
model = lrelu_conv_bn()
summary(model=model,input_size = (1,2,2),batch_size=1,device='cpu')
输出: