<p dir="auto">For example, now I have a parameter 'D' in the model.</p>
<p dir="auto">Now I want to replace the 'D' with 'C', where 'C = a+b'</p>
<p dir="auto">For example, now I have a parameter 'D' in the model.</p>
<p dir="auto">Now I want to replace the 'D' with 'C', where 'C = a+b'. Is there anyway in pytorch that can achieve that replacement while keeping the backpropagation between 'C' and 'a+b'. (e.g., training the model will update the value of 'a' and 'b'.</p>
<p dir="auto">I've tried D.data = C, but obviously that just changed the value and violate the backpropagation. Besides, '.copy' and '.clone' didn't work either.</p>