title: How can the variable computed in the previous epoch be used for computing the loss function in the next epoch?
body: <p>The pytorch code is given below. How can the variable computed in the previous epoch be used for
  computing the loss function in the next epoch?</p>
  <pre><code>for epoch in range((args.start_epoch+1), args.epochs):
    
      for input, target in train_loader:
          target = target.cuda()
          input = input.cuda()
          input_var = torch.autograd.Variable(input)
          target_var = torch.autograd.Variable(target)
          outputs, feature = model(input_var)
  
          if epoch &gt; 0:
              l = criterion.forward(feature,target_var, Fea)
  
      Fea = function(model,train_loader)
  </code></pre>