>>> print(foo.grad_fn) <AddBackward0 object at 0x7f7f9f450710>
I want to copy from
bar.grad_fn. For reference, no
foo.data is required. I want to copy only the
Is this possible? I tried the following and it failed.
>>> bar.grad_fn = foo.grad_fn AttributeError: attribute 'grad_fn' of 'torch._C._TensorBase' objects is not writable