Hi @ptrblck , it’s the same thing
class Autoencoder(nn.Module):
    def __init__(self):
        super(Autoencoder, self).__init__()
        self.encoder = nn.Sequential(
            nn.Conv2d(1, 16, 3, stride=2, padding=1),
            nn.ReLU(),
            nn.Conv2d(16, 32, 3, stride=2, padding=1),
            nn.ReLU(),
            nn.Conv2d(32, 64, 3)
        )
        self.decoder = nn.Sequential(
            nn.ConvTranspose2d(64, 32, 3),
            nn.ReLU(),
            nn.ConvTranspose2d(32, 16, 3, stride=2, padding=1, output_padding=1),
            nn.ReLU(),
            nn.ConvTranspose2d(16, 1, 3, stride=2, padding=1, output_padding=1),
            
        )

    def forward(self, x):
        x = self.encoder(x)
        x = self.decoder(x)
        return x


x_train, y_train = Variable(train_x), Variable(train_y)
   
    x_val, y_val = Variable(val_x), Variable(val_y)
  
    if torch.cuda.is_available():
      
        x_train = x_train.cuda()
        y_train = y_train.cuda()
        x_val = x_val.cuda()
        y_val = y_val.cuda()

  
    optimizer.zero_grad()

    
    output_train = model(x_train.float())
    output_val = model(x_val.float())
    

   
    loss_train = criterion(output_train, y_train.long())

help me plzz