Hello, thank you for your response, I find this code on this GIT :

  
      github.com
  
  
    RUSH-LAB/LSH_Memory/blob/master/cnn.py 10
import os
import sys
import numpy as np

import torch
import torchvision
import torchvision.transforms as transforms

from torch.autograd import Variable
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F

import omniglot
import memory

class Net(nn.Module):
    def __init__(self, input_shape):
        super(Net, self).__init__()
        # Constants


  This file has been truncated. show original

  
  
    
    
  
  


At line 81 : loss.backward(), they say that the entrance must be the same as the exit.
Thank you ErikJ