TENSOR MANIPULATION : 텐서 조작¶ In [5]: import torch import numpy as np # 1차원 print('*'*20) print('1D TORCH') print('*'*20) t = torch.FloatTensor([0,1,2,3,4,5,6]) print(t) print(t.dim()) # rank. 즉, 차원 print(t.shape) # shape print(t.size()) # shape print(t[0], t[1], t[-1]) # 인덱스로 접근 print(t[2:5], t[4:-1]) # 슬라이싱 print(t[:2], t[3:]) # 슬라이싱 # 2차원 print('\n') print('*'*20) print('2D TORCH') print('*'*2..