mindspore.ops.coo_log
- mindspore.ops.coo_log(x: COOTensor)[source]
Returns the natural logarithm of a COOTensor element-wise.
\[y_i = log_e(x_i)\]Warning
If the input value of operator Log is within the range (0, 0.01] or [0.95, 1.05], the output accuracy may be affacted.
- Parameters
x (COOTensor) – The value must be greater than 0.
- Returns
COOTensor, has the same shape and dtype as the x.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> indices = Tensor([[0, 1], [1, 2]], dtype=mstype.int64) >>> values = Tensor([-1, 2], dtype=mstype.float32) >>> shape = (3, 4) >>> x = COOTensor(indices, values, shape) >>> output = ops.coo_log(x) >>> print(output.values) [ nan 0.69314575]