PyTorch torch.log2 Function
PyTorch torch Reference Manual
torch.log2Is a function in PyTorch used to compute the base-2 logarithm.
Function Definition
torch.log2(input, out)
Usage Example
Example
import torch
# Compute the base-2 logarithm
x = torch.tensor([1, 2, 4, 8, 16])
result = torch.log2(x)
print(result)
# Compute the base-2 logarithm
x = torch.tensor([1, 2, 4, 8, 16])
result = torch.log2(x)
print(result)
Other Extensions