Returns a one-dimensional tensor of steps points logarithmically spaced between 10^start and 10^end.

tch_logspace(start, end, steps = 100, dtype = NULL, layout = NULL,
  device = NULL, requires_grad = FALSE)

Arguments

start

the starting value for the set of points.

end

the ending value for the set of points.

steps

number of points to sample between start and end. Default: 100.

dtype

the desired data type of returned tensor. Default: if NULL, infers data type from x.

device

the desired device of returned tensor. Default: if NULL, uses the current device for the default tensor type (see tch_set_default_tensor_type()). device will be the CPU for CPU tensor types and the current CUDA device for CUDA tensor types.

requires_grad

If autograd should record operations on the returned tensor. Default: FALSE.

fill_value

the number to fill the output tensor with.

the

desired layout of returned Tensor. Default: 'strided'

Details

The output tensor is 1-D of size steps.

Examples

tch_linspace(3, 10, steps = 5)
#> tensor #> 3.0000 #> 4.7500 #> 6.5000 #> 8.2500 #> 10.0000 #> [ Variable[CPUFloatType]{5} ]
tch_linspace(-10, 10, steps = 5)
#> tensor #> -10 #> -5 #> 0 #> 5 #> 10 #> [ Variable[CPUFloatType]{5} ]
tch_linspace(start = -10, end = 10, steps = 5)
#> tensor #> -10 #> -5 #> 0 #> 5 #> 10 #> [ Variable[CPUFloatType]{5} ]
#> tensor #> 0.0000 #> 0.0101 #> 0.0202 #> 0.0303 #> 0.0404 #> 0.0505 #> 0.0606 #> 0.0707 #> 0.0808 #> 0.0909 #> 0.1010 #> 0.1111 #> 0.1212 #> 0.1313 #> 0.1414 #> 0.1515 #> 0.1616 #> 0.1717 #> 0.1818 #> 0.1919 #> 0.2020 #> 0.2121 #> 0.2222 #> 0.2323 #> 0.2424 #> 0.2525 #> 0.2626 #> 0.2727 #> 0.2828 #> 0.2929 #> 0.3030 #> 0.3131 #> 0.3232 #> 0.3333 #> 0.3434 #> 0.3535 #> 0.3636 #> 0.3737 #> 0.3838 #> 0.3939 #> 0.4040 #> 0.4141 #> 0.4242 #> 0.4343 #> 0.4444 #> 0.4545 #> 0.4646 #> 0.4747 #> 0.4848 #> 0.4949 #> 0.5051 #> 0.5152 #> 0.5253 #> 0.5354 #> 0.5455 #> 0.5556 #> 0.5657 #> 0.5758 #> 0.5859 #> 0.5960 #> 0.6061 #> 0.6162 #> 0.6263 #> 0.6364 #> 0.6465 #> 0.6566 #> 0.6667 #> 0.6768 #> 0.6869 #> 0.6970 #> 0.7071 #> 0.7172 #> 0.7273 #> 0.7374 #> 0.7475 #> 0.7576 #> 0.7677 #> 0.7778 #> 0.7879 #> 0.7980 #> 0.8081 #> 0.8182 #> 0.8283 #> 0.8384 #> 0.8485 #> 0.8586 #> 0.8687 #> 0.8788 #> 0.8889 #> 0.8990 #> 0.9091 #> 0.9192 #> 0.9293 #> 0.9394 #> 0.9495 #> 0.9596 #> 0.9697 #> 0.9798 #> 0.9899 #> 1.0000 #> [ Variable[CPUFloatType]{100} ]