提交 c19ab1e1 编写于 作者: G GaoWei8 提交者: cyj1986

Fix cos doc (#1221)

* Fix cos doc
test=document_preview

* fix cos
test=document_preview

* fix cos doc
test=document_preview

* fix cos doc
test=document_preview

* test=document_preview
上级 47d3b5cd
...@@ -5,7 +5,7 @@ cos ...@@ -5,7 +5,7 @@ cos
.. py:function:: paddle.fluid.layers.cos(x, name=None) .. py:function:: paddle.fluid.layers.cos(x, name=None)
Cosine余弦激活函数。 余弦函数。
.. math:: .. math::
...@@ -14,25 +14,25 @@ Cosine余弦激活函数。 ...@@ -14,25 +14,25 @@ Cosine余弦激活函数。
参数: 参数:
- **x** (Variable) - 该OP的输入为多维Tensor,数据类型为float32,float64。
- **name** (str, 可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为None。
- **x** - cos算子的输入
- **use_cudnn** (BOOLEAN) – (bool,默认为false)是否仅用于cudnn核,需要安装cudnn
返回:输出为Tensor,与 ``x`` 维度相同、数据类型相同。
返回: Cos算子的输出 返回类型:Variable
**代码示例**: **代码示例**:
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
data = fluid.layers.data(name="input", shape=[32, 784]) import numpy as np
result = fluid.layers.cos(data)
input_cos = np.array([[-1,np.pi],[1,15.6]])
with fluid.dygraph.guard():
x = fluid.dygraph.to_variable(input_cos)
y = fluid.layers.cos(x)
print(y.numpy())
# [[ 0.54030231 -1. ]
# [ 0.54030231 -0.99417763]]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册