Calculates the natural log of the given input tensor, element-wise.
Calculates the natural log of the given input tensor, element-wise.
.. math::
.. math::
...
@@ -8681,31 +8677,23 @@ def log(x, name=None):
...
@@ -8681,31 +8677,23 @@ def log(x, name=None):
Out = \\ln(x)
Out = \\ln(x)
Args:
Args:
x (Variable): Input LoDTensor or Tensor. Must be one of the following types: float32, float64.
x (Tensor): Input Tensor. Must be one of the following types: float32, float64.
name (str|None): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`
name (str|None): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`
Returns:
Returns:
Variable: The natural log of the input LoDTensor or Tensor computed element-wise.
Tensor: The natural log of the input Tensor computed element-wise.
Examples:
Examples:
.. code-block:: python
.. code-block:: python
import paddle.fluid as fluid
import paddle
import numpy as np
# Graph Organizing
x = fluid.layers.data(name="x", shape=[1], dtype="float32")
x(Variable): Input N-D Tensor of scale operator. Data type can be float32, float64, int8, int16, int32, int64, uint8.
x(Tensor): Input N-D Tensor of scale operator. Data type can be float32, float64, int8, int16, int32, int64, uint8.
scale(float|Variable): The scale factor of the input, it should be a float number or a Variable with shape [1] and data type as float32.
scale(float|Tensor): The scale factor of the input, it should be a float number or a Tensor with shape [1] and data type as float32.
bias(float): The bias to be put on the input.
bias(float): The bias to be put on the input.
bias_after_scale(bool): Apply bias addition after or before scaling. It is useful for numeric stability in some circumstances.
bias_after_scale(bool): Apply bias addition after or before scaling. It is useful for numeric stability in some circumstances.
act(str, optional): Activation applied to the output such as tanh, softmax, sigmoid, relu.
act(str, optional): Activation applied to the output such as tanh, softmax, sigmoid, relu.
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`
Returns:
Returns:
Variable(Tensor|LoDTensor): Output tensor of scale operator, with shape and data type same as input.
Tensor: Output tensor of scale operator, with shape and data type same as input.