title: Pytorch - Trick AutoGrad into thinking another output is the final outcome
body: <h3>The scenario:</h3>
  <ul>
  <li><p>I have a simple torch CNN network that predicts if a given image input is a dog or a cat.</p>
  </li>
  <li><p>After getting the output of the neural network, I need to apply a modifier of X to each prediction. For example, if the neural network return [0.6, 0.4], and I want to apply a modifier of [0.05, -0.03], I need the result to be [0.65, 0.37].</p>
  </li>
  </ul>
  <h3>The desired result:</h3>
  <ul>
  <li>I would like AutoGrad to think the final output is [0.65, 0.37]. That is, AutoGrad shouldn't consider the modifier addition at all. In fact, It needs to be tricked into thinking the last operation result is [0.65, 0.37] instead of [0.6, 0.4], and apply the backpropagation with that in mind.</li>
  </ul>
  <h3>Here's what I need to know:</h3>
  <ul>
  <li>How am I suppose to do this? I know Torch records every single operation and compute a dynamic graph accordingly. I don't want this operation to be recorded at all, and I can't use the <code>torch.no_grad()</code> wrapper, because I need to be able to do the backpropagation after.</li>
  </ul>
  <hr />
  <h3>Edit 1</h3>
  <p>@trsvchn Here's what happen when I do your method. Is this expected? Will autograd use the &quot;T&quot; value instead of the &quot;data&quot; value when doing the backpropagation?</p>
  <p><a href="https://i.stack.imgur.com/WafOI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WafOI.png" alt="enter image description here" /></a></p>