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

25 lines
970 B
ReStructuredText
Raw 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.Cauchy
====================
.. py:class:: mindspore.ops.Cauchy(size, sigma=1.0, median=0.0)
从柯西分布中提取的随机数创建shape由 `size` 决定的Tensor。
.. math::
f(x)= \frac{1}{\pi} \frac{\sigma}{(x-median)^2 +\sigma^2}
参数:
- **size** (list[int]) - 描述输出Tensor的shape。
- **sigma** (float可选) - 位置参数指定分布峰值的位置。默认值1.0。
- **median** (float可选) - 尺度参数指定半宽半最大值处的scale参数。默认值0.0。
输出:
Tensor数据类型为float32shape由 `size` 决定的Tensor。Tensor中的数值符合柯西分布。
异常:
- **TypeError** - `sigma` 不是float。
- **TypeError** - `median` 不是float。
- **TypeError** - `size` 不是list。
- **ValueError** - `size` 是空的。
- **ValueError** - `size` 中的数值不是正数。