_tensor_sqrt
tensor_sqrt
¶
Computes element-wise square root of tensor elements.
This method can be used with Numpy data:
n = np.array([[1, 4, 6], [4, 9, 16]])
b = fe.backend.tensor_sqrt(n) # [[1.0, 2.0, 2.44948974], [2.0, 3.0, 4.0]]
This method can be used with TensorFlow tensors:
t = tf.constant([[1, 4, 6], [4, 9, 16]], dtype=tf.float32)
b = fe.backend.tensor_sqrt(t) # [[1.0, 2.0, 2.4494898], [2.0, 3.0, 4.0]]
This method can be used with PyTorch tensors:
p = torch.tensor([[1, 4, 6], [4, 9, 16]], dtype=torch.float32)
b = fe.backend.tensor_sqrt(p) # [[1.0, 2.0, 2.4495], [2.0, 3.0, 4.0]]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
tensor |
Tensor
|
The input tensor. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
The |
Raises:
Type | Description |
---|---|
ValueError
|
If |