@@ -5,31 +5,26 @@ logspace
55
66.. py :function :: paddle.logspace(start, stop, num, base = 10.0 , dtype = None , name = None )
77
8- 该OP返回一个Tensor,Tensor的值为在区间 :math: `[base^{start}, base^{stop}]` 上按对数均匀间隔的 :math: `num` 个值,输出Tensor的长度为num。
9- **注意:该OP不进行梯度计算 **
8+ 返回一个 Tensor,Tensor 的值为在区间 :math: `[base^{start}, base^{stop}]` 上按对数均匀间隔的 :math: `num` 个值,输出 Tensor 的长度为 num。
9+
10+ .. note ::
11+ ``paddle.logspace `` 不进行梯度计算。
1012
1113参数
1214::::::::::::
1315
14- - **start ** (int|float|Tensor) – ``start `` 是区间开始值以 ``base `` 为底的指数,可以是一个标量,或是一个shape为 [1]的Tensor,该Tensor的数据类型可以是float32, float64, int32 或者int64 。
15- - **stop ** (int|float|Tensor) – ``stop `` 是区间结束值以 ``base `` 为底的指数,可以是一个标量,或是一个shape为 [1]的Tensor,该Tensor的数据类型可以是float32, float64,int32或者int64 。
16- - **num ** (int|Tensor) – ``num `` 是给定区间内需要划分的区间数,可以是一个整型标量,或是一个shape为 [1]的Tensor,该Tensor的数据类型需为int32 。
17- - **base ** (int|float|Tensor) – ``base `` 是对数函数的底数,可以是一个标量,或是一个shape为 [1]的Tensor,该Tensor的数据类型可以是float32, float64,int32或者int64 。
18- - **dtype ** (np.dtype|str, 可选) – 输出Tensor的数据类型,可以是float32, float64, int32或者int64。如果dtype的数据类型为None,输出Tensor数据类型为float32 。
19- - **name ** (str, 可选)- 具体用法请参见 :ref: `api_guide_Name ` ,一般无需设置,默认值为None 。
16+ - **start ** (int|float|Tensor) – ``start `` 是区间开始值以 ``base `` 为底的指数,可以是一个标量,或是一个 shape 为 [1] 的 Tensor,该 Tensor 的数据类型可以是 float32、 float64、 int32 或者 int64 。
17+ - **stop ** (int|float|Tensor) – ``stop `` 是区间结束值以 ``base `` 为底的指数,可以是一个标量,或是一个 shape 为 [1] 的 Tensor,该 Tensor 的数据类型可以是 float32、 float64、int32 或者 int64 。
18+ - **num ** (int|Tensor) – ``num `` 是给定区间内需要划分的区间数,可以是一个整型标量,或是一个 shape 为 [1] 的 Tensor,该 Tensor 的数据类型需为 int32 。
19+ - **base ** (int|float|Tensor) – ``base `` 是对数函数的底数,可以是一个标量,或是一个 shape 为 [1] 的 Tensor,该 Tensor 的数据类型可以是 float32、 float64、int32 或者 int64 。
20+ - **dtype ** (np.dtype|str, 可选) – 输出Tensor的数据类型,可以是 float32、 float64,int32 或者 int64。如果 dtype 的数据类型为 None,输出 Tensor 数据类型为 float32 。
21+ - **name ** (str,可选)- 具体用法请参见 :ref: `api_guide_Name `,一般无需设置,默认值为 None 。
2022
2123返回
2224::::::::::::
23- 等对数间隔划分的1 -D Tensor,该Tensor的shape大小为 :math: `[num]` ,在num为1的情况下 ,仅返回包含 :math: `base^{start}` 值的Tensor 。
25+ 等对数间隔划分的 1 -D Tensor,该 Tensor 的 shape 大小为 :math: `[num]` ,在 num 为 1 的情况下 ,仅返回包含 :math: `base^{start}` 值的 Tensor 。
2426
2527
2628代码示例
2729::::::::::::
28-
29- .. code-block :: python
30-
31- import paddle
32- data = paddle.logspace(0 , 10 , 5 , 2 , ' float32' )
33- # [1. , 5.65685415 , 32. , 181.01933289, 1024. ]
34- data = paddle.logspace(0 , 10 , 1 , 2 , ' float32' )
35- # [1.]
30+ COPY-FROM: <logspace>:<logspace-example>
0 commit comments