pytaco.tensor_log10

pytaco.tensor_log10(t1, out_format, dtype=None)

Takes the log base 10 of each input in the tensor.

Note that this is applied to all elements in the tensor not just non-zeros.

Parameters
t1: tensor, array_like

input tensor or array_like object

out_format: format, mode_format, optional
  • If a format is specified, the result tensor is stored in the format out_format.

  • If a mode_format is specified, the result the result tensor has a with all of the dimensions stored in the mode_format passed in.

dtype: Datatype

The datatype of the output tensor.

Returns
log10: tensor

The element wise log10 of the input tensor.

Warning

The log10 of 0 is undefined and is performed on every element in the tensor regardless of sparsity.

Examples

>>> import pytaco as pt
>>> pt.tensor_log10([10, 100], out_format=pt.compressed, dtype=pt.float32).to_array()
array([1., 2.], dtype=float32)