thank you  After reading more about leaf tensors I understood that, so I wasn’t sure why I was told to multiply it by 1.0 by my supervisor as a solution (I had the same error before writing the line where I multiply with 1.0). But I have resolved it.