when I tested this code
def forward(self,x):
        out1 = self.cnn1(x)
        out = self.batchnorm1(out1)
        out = self.relu(out)
        out = self.maxpool1(out)
        out = out.view(out.size(0),-1)
        out = self.fc1(out)
        out2 = self.batchnorm1(out1)
        out2 = self.relu(out2)
        out2 = nn.AvgPool2d(out2)
        out2 = self.fc2(out2)
        out=torch.cat((out,out2), dim =1)


ModuleAttributeError: 'AvgPool2d' object has no attribute 'dim'

help me plzz