if you want end
to be included, torch.linspace
is the function that would do what you want more precisely – by definition: https://pytorch.org/docs/stable/torch.html?highlight=linspace#torch.linspace
3 Likes