PyTorch confusables 대잔치 ep.1 [pytorch dim]
What are dims in pytorch?- "dim" stands for dimensions- same as numpy "axis"- for a 2D torch.Tensor, dim==0 goes along the rows, dim==1 goes along the colsCode:a = torch.randn(5, 5)b = torch.argmax(a) # torch.argmax(input, dim=None, keepdim=False)Output:tensor([[-8.4741e-01, 3.6448e-01, 1.4155e+00, 2.6417e-01, -3.4608e-01], [-8.9281e-01, -3.1258e-01, 1.4784e+00, 2.9023e-01, -1.0445e+..
2024.05.09