log¶
- nvtripy.log(input: Tensor) Tensor[source]¶
Computes the elementwise natural logarithm (base e) of the elements of the input tensor.
- Parameters:
input (Tensor) – The input tensor.
- Returns:
A new tensor of the same shape as the input tensor.
- Return type:
- INPUT REQUIREMENTS:
- OUTPUT GUARANTEES:
return[0].dtype==input.dtype
Example
1input = tp.arange(1, 3, dtype=tp.float32) 2output = tp.log(input)
Local Variables¶>>> input tensor([1, 2], dtype=float32, loc=gpu:0, shape=(2,)) >>> output tensor([0, 0.693147], dtype=float32, loc=gpu:0, shape=(2,))