天天看點

tf.squard_difference() 和 tf.square()差別

tf.square(
    x,
    name=None
)

Computes square of x element-wise.

I.e., y = x*x = x^2.

Returns:
A Tensor or SparseTensor. Has the same type as x.




tf.math.squared_difference(
    x,
    y,
    name=None
)

Returns (x - y)(x - y) element-wise.

Returns:
A Tensor. Has the same type as x.
           

tf.square()是對一個元素的操作

tf.squared_difference()是對兩個元素的操作。

繼續閱讀