Python – tensorflow.math.squared_difference()
TensorFlow是谷歌设计的开源Python库,用于开发机器学习模型和深度学习神经网络。
squared_difference()用于计算元素的(x-y)(x-y)。
语法: tensorflow.math.squared_difference(x, y, name)
参数:
- x:它是一个张量。允许的d类型是bfloat16, half, float32, float64, complex64, complex128。
- y:它是一个与x的d类型相同的张量。
- name(可选):它定义了该操作的名称。
返回:它返回一个张量。
示例 1:
输出:
例子2:接受复杂的输入
输出: