[Pytorch] 기본 사용법
Tensor 생성
``` torch.tensor([1, 2, 3, 4])
``` torch.tensor([1, 2, 3, 4])
Tensor 생성 parameter에는 requires_grad가 존재한다. 
 default값은 False로 이 값을 True로 할경우 grad를 구하게 된다. 
 즉, 경사하강법에서 사용되는 weight의 경우는 grad를 구해야 하지만 
 입력값은 고정된 값이므로 grad를 구할 필요가 없다.
w = torch.randn(3, requires_grad = True)
if torch.cuda.is_available():
    device = torch.device("cuda")
		# 설정 Option 1
		x = torch.ones(5, device = device)
		# 설정 Option 2
		y = torch.ones(5)
		y = y.to(device)
		
		z = x + y
		
		# GPU에서 CPU로 변경
		z = z.to("cpu")