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

33 lines
1.6 KiB
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.LogSpace
======================
.. py:class:: mindspore.ops.LogSpace(steps=10, base=10, dtype=mstype.float32)
返回一个大小为 `steps` 的1-D Tensor其值从 :math:`base^{start}`:math:`base^{end}` ,以 `base` 为底数。
.. math::
\begin{aligned}
&step = (end - start)/(steps - 1)\\
&output = [base^{start}, base^{start + 1 * step}, ... , base^{start + (steps-2) * step}, base^{end}]
\end{aligned}
参数:
- **steps** (int可选) - `steps` 必须为非负整数。默认值10。
- **base** (int可选) - `base` 必须为非负整数。默认值10。
- **dtype** (mindspore.dtype可选) - 输出的数据类型支持mindspore.float16、mindspore.float32或mindspore.float64(对于GPU)。默认值mindspore.float32。
输入:
- **start** (Tensor) - 间隔的起始值shape为0-D数据类型为float16、float32或float64对于GPU类型。
- **end** (Tensor) - 间隔的结束值shape为0-D数据类型为float16、float32或float64对于GPU类型。
输出:
Tensorshape为 :math:`(step, )` ,数据类型由属性 `dtype` 设置。
异常:
- **TypeError** - 若 `input` 不是一个Tensor。
- **TypeError** - 若 `steps` 不是一个整数。
- **TypeError** - 若 `base` 不是一个整数。
- **TypeError** - 若 `dtype` 不是mindspore.float16、mindspore.float32或mindspore.float64(对于GPU)。
- **ValueError** - 若 `steps` 不是非负整数。
- **ValueError** - 若 `base` 不是非负整数。