PyTorch torch.logspace function
PyTorch torch reference manual
torch.logspace is a function in PyTorch used to create a tensor with logarithmically spaced values.
Function definition
torch.logspace(start, end, steps, base, dtype, device, requires_grad)
Usage examples
Example
import
torch
Create a logarithmically spaced sequence with base 10
x
=
torch.
logspace
(
0
,
1
,
5
)
(
x
)
The output is:
tensor([ 1.0000, 1.7783, 3.1623, 5.6234, 10.0000])