Skip to content

Commit

Permalink
Add log10 Chinese doc (PaddlePaddle#2842)
Browse files Browse the repository at this point in the history
As the title
  • Loading branch information
Joejiong authored Nov 10, 2020
1 parent bf7a547 commit 127423f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/paddle/api/alias_api_mapping
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ paddle.fluid.layers.add_position_encoding paddle.nn.functional.add_position_enco
paddle.nn.functional.common.cosine_similarity paddle.nn.functional.cosine_similarity
paddle.fluid.layers.floor paddle.floor,paddle.tensor.floor,paddle.tensor.math.floor
paddle.fluid.layers.log2 paddle.log2,paddle.tensor.log2,paddle.tensor.math.log2
paddle.fluid.layers.log10 paddle.log10,paddle.tensor.log10,paddle.tensor.math.log10
paddle.tensor.math.log1p paddle.log1p,paddle.tensor.log1p
paddle.fluid.layers.unstack paddle.unstack,paddle.tensor.unstack,paddle.tensor.manipulation.unstack
paddle.fluid.layers.rsqrt paddle.rsqrt,paddle.tensor.rsqrt,paddle.tensor.math.rsqrt
Expand Down
47 changes: 47 additions & 0 deletions doc/paddle/api/paddle/fluid/layers/log10_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _cn_api_fluid_layers_log10:

log10
-------------------------------

.. py:function:: paddle.log10(x, name=None)
Log10激活函数(计算底为10的对数)

.. math::
\\Out=log_{10} x\\
参数:
- **x** (Tensor) – 该OP的输入为Tensor。数据类型为float32,float64。
- **name** (str,可选) – 该参数供开发人员打印调试信息时使用,具体用法请参见 :ref:`api_guide_Name` ,默认值为None。

返回:Log10算子底为10对数输出

返回类型: Tensor - 该OP的输出为Tensor,数据类型为输入一致。


**代码示例**

.. code-block:: python
import paddle
# example 1: x is a float
x_i = paddle.to_tensor([[1.0], [10.0]])
res = paddle.log10(x_i) # [[0.], [1.0]]
# example 2: x is float32
x_i = paddle.full(shape=[1], fill_value=10, dtype='float32')
paddle.to_tensor(x_i)
res = paddle.log10(x_i)
print(res.numpy()) # [1.0]
# example 3: x is float64
x_i = paddle.full(shape=[1], fill_value=10, dtype='float64')
paddle.to_tensor(x_i)
res = paddle.log10(x_i)
print(res.numpy()) # [1.0]

0 comments on commit 127423f

Please sign in to comment.