tf.math.sqrt
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Computes element-wise square root of the input tensor.
tf.math.sqrt(
x, name=None
)
Used in the notebooks
| Used in the guide |
Used in the tutorials |
|
|
|
x = tf.constant([[4.0], [16.0]])
tf.sqrt(x)
<tf.Tensor: shape=(2, 1), dtype=float32, numpy=
array([[2.],
[4.]], dtype=float32)>
y = tf.constant([[-4.0], [16.0]])
tf.sqrt(y)
<tf.Tensor: shape=(2, 1), dtype=float32, numpy=
array([[nan],
[ 4.]], dtype=float32)>
z = tf.constant([[-1.0], [16.0]], dtype=tf.complex128)
tf.sqrt(z)
<tf.Tensor: shape=(2, 1), dtype=complex128, numpy=
array([[0.0+1.j],
[4.0+0.j]])>
Args |
x
|
A tf.Tensor of type bfloat16, half, float32, float64,
complex64, complex128
|
name
|
A name for the operation (optional).
|
Returns |
A tf.Tensor of same size, type and sparsity as x.
If x is a SparseTensor, returns
SparseTensor(x.indices, tf.math.sqrt(x.values, ...), x.dense_shape)
|
如未另行说明,则本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。如需了解详情,请参阅 Google Developers 网站政策。Java 是 Oracle 和/或其关联公司的注册商标。某些内容已根据 Numpy 许可获得了许可。
最后更新时间 (UTC):2024-04-26。
[null,null,["最后更新时间 (UTC):2024-04-26。"],[],[]]