MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / std

Function std

tensorflow/python/keras/backend.py:1967–1983  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1965
1966@keras_export('keras.backend.std')
1967def 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')

Callers

nothing calls this directly

Calls 2

floatxFunction · 0.85
castMethod · 0.45

Tested by

no test coverage detected