Yes, and yes, I have the default set up in the loss.
This my model
class Net(nn.Module):
     def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1,64,kernel_size=3,padding=(1,1))
        self.conv1_bn = nn.BatchNorm2d(64)
        self.conv2 = nn.Conv2d(64,64,kernel_size=3,padding=(1,1))
        self.conv2_bn = nn.BatchNorm2d(64)
        self.conv3 = nn.Conv2d(64,8,kernel_size=3,padding=(1,1))
        self.conv3_bn = nn.BatchNorm2d(8)
        self.conv4 = nn.Conv2d(8,8,kernel_size=3,padding=(1,1))
        self.conv4_bn = nn.BatchNorm2d(8)
        self.conv5 = nn.Conv2d(8,8,kernel_size=3,padding=(1,1))
        self.conv5_bn = nn.BatchNorm2d(8)
        self.conv6 = nn.Conv2d(8,16,kernel_size=3,padding=(1,1))
        self.conv6_bn = nn.BatchNorm2d(16)
        self.fc1 = nn.Linear(16*225,1)
        
    def forward(self,x):
	    x = x.float()        
	    x = x.view(-1,1,15,15)
        x = F.relu(self.conv1_bn(self.conv1(x)))
        x = F.relu(self.conv2_bn(self.conv2(x)))
        x = F.relu(self.conv3_bn(self.conv3(x)))
        x = F.relu(self.conv4_bn(self.conv4(x)))
        x = F.relu(self.conv5_bn(self.conv5(x)))
        x = F.relu(self.conv6_bn(self.conv6(x)))
        x = self.conv7(x)
        x = x.view(-1,225)
        
        return x

My input is a 15x15 patch and my output as well. That’s why I have 225.