mindspore/docs/api/api_python/ops/mindspore.ops.func_var.rst

20 lines
969 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.var
==================
.. py:function:: mindspore.ops.var(input, axis=None, ddof=0, keepdims=False)
计算tensor在指定轴上的方差。
参数:
- **input** (Tensor[Number]) - 输入tensor。
- **axis** (Union[int, tuple(int)],可选) - 指定轴。如果为 ``None`` ,计算 `input` 中的所有元素。默认 ``None``
- **ddof** (Union[int, bool],可选) - δ自由度。默认 ``0``
- 如果为整数,计算中使用的除数是 :math:`N - ddof` ,其中 :math:`N` 表示元素的数量。
- 如果为bool值 ``True````False`` 分别对应ddof为整数时的 ``1````0``
- 如果取值为0、1、True或False支持的平台只有 `Ascend``CPU` 。其他情况下,支持平台是 `Ascend``GPU``CPU`
- **keepdims** (bool可选) - 输出tensor是否保留维度。默认 ``False``
返回:
Tensor