Standard deviation of a tensor, alongside the specified axis. Arguments: x: A tensor or variable. axis: An integer, the axis to compute the standard deviation. keepdims: A boolean, whether to keep the dimensions or not. If `keepdims` is `False`, the rank of the tensor
(x, axis=None, keepdims=False)
| 1965 | |
| 1966 | @keras_export('keras.backend.std') |
| 1967 | def std(x, axis=None, keepdims=False): |
| 1968 | """Standard deviation of a tensor, alongside the specified axis. |
| 1969 | |
| 1970 | Arguments: |
| 1971 | x: A tensor or variable. |
| 1972 | axis: An integer, the axis to compute the standard deviation. |
| 1973 | keepdims: A boolean, whether to keep the dimensions or not. |
| 1974 | If `keepdims` is `False`, the rank of the tensor is reduced |
| 1975 | by 1. If `keepdims` is `True`, |
| 1976 | the reduced dimension is retained with length 1. |
| 1977 | |
| 1978 | Returns: |
| 1979 | A tensor with the standard deviation of elements of `x`. |
| 1980 | """ |
| 1981 | if x.dtype.base_dtype == dtypes_module.bool: |
| 1982 | x = math_ops.cast(x, floatx()) |
| 1983 | return math_ops.reduce_std(x, axis=axis, keepdims=keepdims) |
| 1984 | |
| 1985 | |
| 1986 | @keras_export('keras.backend.mean') |