OK thanks I am clear now. For some reason I was assuming (wrong assumption) that a double application of
torch.autograd.backward([z],[val],retain_variables=True)
would calculate the second derivative which would require a multiplication, and hence was inferring that the same would apply to :
torch.autograd.backward([z],[val],retain_variables=True)
torch.autograd.backward([y],[val],retain_variables=True) 

Now I am clear. Thanks