I saw that .clone() was part of the computation graph and thought it was really weird. Why is that?
I wanted to know

what it even meant to take derivatives with respect to such an operation (I thought it shouldn’t be defined)
Why is it part of the computation graph if one can’t take derivatives wrt to clone

Look its in the graph?!
#%%

## Q: 

import torch
from torchviz import make_dot

x = torch.randn(1, requires_grad=True)

temp = x**2
# y = temp.clone().detach()
y = temp.clone()
print(f'y.is_leaf= {y.is_leaf}')
print(f'y.requires_grad = {y.requires_grad}')
temp = temp+y

print(temp)

temp.backward()

print(f'x.grad = {x.grad}')
print(f'y.grad = {y.grad}')

make_dot(temp)
# make_dot(temp)


Screen Shot 2020-01-18 at 3.36.46 PM858×1310 74 KB