Notice
Recent Posts
Recent Comments
Link
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

Deep CV

[Pytorch] torch.linspace 본문

딥러닝/PyTorch

[Pytorch] torch.linspace

Present_Kim 2021. 10. 18. 00:01
torch.linspace(start, end, steps, *, out=None, dtype=None, layout=torch.strided, device=None, requires_grad=False)

start와 end를 사이가 균일하게 나눠진 steps 크기의 tensor를 생성합니다. 

Parameters

  • start (float) – the starting value for the set of points
  • end (float) – the ending value for the set of points
  • steps (int) – size of the constructed tensor

Example

>>> torch.linspace(3, 10, steps=5)
tensor([  3.0000,   4.7500,   6.5000,   8.2500,  10.0000])
>>> min = torch.linspace(-1, 1, steps=4)
tensor([-1.0000,  -0.3333,  0.3333,  1.0000])