Element-wise square root. Arguments: x: Tensor or variable. Returns: A tensor.
(x)
| 2091 | |
| 2092 | @keras_export('keras.backend.sqrt') |
| 2093 | def sqrt(x): |
| 2094 | """Element-wise square root. |
| 2095 | |
| 2096 | Arguments: |
| 2097 | x: Tensor or variable. |
| 2098 | |
| 2099 | Returns: |
| 2100 | A tensor. |
| 2101 | """ |
| 2102 | zero = _constant_to_tensor(0., x.dtype.base_dtype) |
| 2103 | inf = _constant_to_tensor(np.inf, x.dtype.base_dtype) |
| 2104 | x = clip_ops.clip_by_value(x, zero, inf) |
| 2105 | return math_ops.sqrt(x) |
| 2106 | |
| 2107 | |
| 2108 | @keras_export('keras.backend.exp') |