목록코랩 (1)
거북목개발자
기본 torch 함수 (tensor 형식으로 변경, torch.rand())
Tensor 형식 float형(default) : x = torch.FloatTensor(x) int형 : x = torch.IntTensor(x) Boolean형 : x = torch.BoolTensor 초기화 및 기본 작업 Tensor는 torch.tensor() 생성자를 사용하여 Python list 또는 sequence 에서 생성할 수 있습니다 >>> torch.tensor([[1., -1.], [1., -1.]]) tensor([[ 1.0000, -1.0000], [ 1.0000, -1.0000]]) >>> torch.tensor(np.array([[1, 2, 3], [4, 5, 6]])) tensor([[ 1, 2, 3], [ 4, 5, 6]]) 랜덤 값 Tensor 생성 torch.rand(..
Study/Machine Learning
2021. 10. 12. 17:06