import torch as t import torch.nn as nn import torch.nn.functional as F from torchvision import models # 残差快 残差网络公式 a^[L+] = g(a^[L]+z^[L+]) class ResidualBlock(nn.Module): def __init__(self, inchannel, outchannel, stride=, shortcut=None): #shortcut=…