[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.math.sqrt\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/math_ops.py#L5420-L5455) |\n\nComputes element-wise square root of the input tensor.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.sqrt`](https://www.tensorflow.org/api_docs/python/tf/math/sqrt)\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.sqrt`](https://www.tensorflow.org/api_docs/python/tf/math/sqrt)\n\n\u003cbr /\u003e\n\n tf.math.sqrt(\n x, name=None\n )\n\n### Used in the notebooks\n\n| Used in the guide | Used in the tutorials |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| - [Distributed training with Core APIs and DTensor](https://www.tensorflow.org/guide/core/distribution) - [Multilayer perceptrons for digit recognition with Core APIs](https://www.tensorflow.org/guide/core/mlp_core) - [Optimizers with Core APIs](https://www.tensorflow.org/guide/core/optimizers_core) | - [Uncertainty-aware Deep Learning with SNGP](https://www.tensorflow.org/tutorials/understanding/sngp) - [TFP Release Notes notebook (0.12.1)](https://www.tensorflow.org/probability/examples/TFP_Release_Notebook_0_12_1) - [Copulas Primer](https://www.tensorflow.org/probability/examples/Gaussian_Copula) - [Substantial Undocumented Infection Facilitates the Rapid Dissemination of Novel Coronavirus (SARS-CoV2)](https://www.tensorflow.org/probability/examples/Undocumented_Infection_and_the_Dissemination_of_SARS-CoV2) - [Neural machine translation with a Transformer and Keras](https://www.tensorflow.org/text/tutorials/transformer) |\n\n**Note:** This operation does not support integer types. \n\n x = tf.constant([[4.0], [16.0]])\n tf.sqrt(x)\n \u003ctf.Tensor: shape=(2, 1), dtype=float32, numpy=\n array([[2.],\n [4.]], dtype=float32)\u003e\n y = tf.constant([[-4.0], [16.0]])\n tf.sqrt(y)\n \u003ctf.Tensor: shape=(2, 1), dtype=float32, numpy=\n array([[nan],\n [ 4.]], dtype=float32)\u003e\n z = tf.constant([[-1.0], [16.0]], dtype=tf.complex128)\n tf.sqrt(z)\n \u003ctf.Tensor: shape=(2, 1), dtype=complex128, numpy=\n array([[0.0+1.j],\n [4.0+0.j]])\u003e\n\n| **Note:** In order to support complex type, please provide an input tensor of `complex64` or `complex128`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|--------------------------------------------------------------------------------------------------------------|\n| `x` | A [`tf.Tensor`](../../tf/Tensor) of type `bfloat16`, `half`, `float32`, `float64`, `complex64`, `complex128` |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A [`tf.Tensor`](../../tf/Tensor) of same size, type and sparsity as `x`. \u003cbr /\u003e If `x` is a `SparseTensor`, returns `SparseTensor(x.indices, tf.math.sqrt(x.values, ...), x.dense_shape)` ||\n\n\u003cbr /\u003e"]]