W is a parameter tensor, and A = W[[1,1]] by indexing operator. So the two elements of A are copied from same source. Are the gradients of A[0] and A[1] computed independently? If yes, the computation is double.