Skip to content

log_cn.rst #7236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions docs/api/paddle/log_cn.rst
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
.. _cn_api_paddle_log:

log
-------------------------------

.. py:function:: paddle.log(x, name=None)




paddle.log(x, name=None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要使用 py:function:: 格式,具体请参考其他文档的撰写方法

Log 激活函数(计算自然对数)

.. math::
\\Out=ln(x)\\

.. math::
Out=ln(x)

参数
::::::::::::

- **x** (Tensor) – 输入为 Tensor。数据类型只能为 int32,int64,float16,bfloat16,float32, float64, complex64 或 complex128。
:::::::::
- **x** (Tensor) – 输入的 Tensor。数据类型只能为 int32、int64、float16、bfloat16、float32、float64、 complex64 或 complex128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般使用中文逗号隔开,这里不需要修改

- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
:::::::::
Tensor, Log 算子自然对数输出,数据类型与输入一致。

代码示例
::::::::::::
::::::::::

>>>import paddle

>>>x = [[2, 3, 4], [7, 8, 9]]

>>>x = paddle.to_tensor(x, dtype='float32')

>>>print(paddle.log(x))

Tensor(shape=[2, 3], dtype=float32, place=Place(cpu), stop_gradient=True,

COPY-FROM: paddle.log
[[0.69314718, 1.09861231, 1.38629436],
[1.94591010, 2.07944155, 2.19722462]])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COPY-FROM: paddle.log 是从英文文档的代码示例中自动复制过来,不需要直接写明代码示例吧~