dpctl.tensor.std(x, axis=None, correction=0.0, keepdims=False)[source]

Calculates the standard deviation of elements in the input array x.

  • x (usm_ndarray) – input array.

  • axis (Optional[int, Tuple[int, ...]]) – axis or axes along which the standard deviations must be computed. If a tuple of unique integers, the standard deviations are computed over multiple axes. If None, the standard deviation is computed over the entire array. Default: None.

  • correction (Optional[float, int]) – degrees of freedom adjustment. The divisor used in calculating the standard deviation is N - correction, where N corresponds to the total number of elements over which the standard deviation is calculated. Default: 0.0.

  • keepdims (Optional[bool]) – if True, the reduced axes (dimensions) are included in the result as singleton dimensions, so that the returned array remains compatible with the input array according to Array Broadcasting rules. Otherwise, if False, the reduced axes are not included in the returned array. Default: False.


an array containing the standard deviations. If the standard deviation was computed over the entire array, a zero-dimensional array is returned.

If x has a real-valued floating-point data type, the returned array will have the same data type as x. If x has a boolean or integral data type, the returned array will have the default floating point data type for the device where input array x is allocated.

Return type: