# tensorplay.functional.log2 Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.log2.html ```python tensorplay.functional.log2(input: Tensor, *, out: Tensor | None) → Tensor ``` Returns a new tensor with the logarithm to the base 2 of the elements of input. $$y_{i} = \log_{2} (x_{i})$$ Parameters: input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> a = tensorplay.rand(5) >>> a tensor([ 0.8419, 0.8003, 0.9971, 0.5287, 0.0490]) >>> tensorplay.log2(a) tensor([-0.2483, -0.3213, -0.0042, -0.9196, -4.3504]) ```