Suppose in custom loss function, I want to sum a Tensor x in tensorflow, I can use
x
tf.sum(x)
but if I use a for loop the result