파이토치로 행렬 공부하기
a=torch.tensor([[1.0,2.0],[3.0,4.0]],requires_grad=True)b=torch.tensor([[1.0,2.0],[3.0,4.0]],requires_grad=True)c=a@bprint(a)print(b)print(c) # 결과tensor([[1., 2.], [3., 4.]], requires_grad=True)tensor([[1., 2.], [3., 4.]], requires_grad=True)tensor([[ 7., 10.], [15., 22.]], grad_fn=) k=c.mean()k.backward()print(a.grad)print(b.grad) #결과 tensor([[0.7500, 1.7500], [0.7500, 1..