@braindotai
Thanks for answer. Is this correct way ?
Does actual_loss needed to backward()?
optimizer.zero_grad()
accumulations = 2

scaled_loss = 0
for accumulated_step_i in range(accumulations):
     total_loss = 0
     for idx, (data, target) in train_loader:
          out1 = network(input)
          loss1 = criterion(out1, target1
          total_loss += loss1.item()

          out2 = network(input)
          loss2 = criterion(out2, target)
          total_loss += loss2.item()
          total_loss.backward() # backward here!

          scaled_loss += loss.item()

optimizer.step()

# actual_loss = scaled_loss / accumulations ?
# actual_loss.backward() ?