PyTorch Tensor Shape Convention
- 2D Tensor(Typical Simple Setting) **
- |t| = (Batch size, dim)
- 2차원 Tensor의 크기 |t|, 행렬에서 행의 크기가 batch size, 열의 크기가 dim(dimension)
- 3D Tensor(Typical Computer Vision) **
- |t| = (batch size, width, height)
- 여러 장의 이미지는 batch size, 이미지의 가로 width, 세로 height
- 3D Tensor(Typical Natural Language Processing) **
- |t| = (batch size, length, dim)
- 문장 길이 length, 벡터의 차원 dim
PyTorch Tensor 선언(Allocation)
- 브로드캐스팅(BroadCasting)
- 크기가 다른 행렬 또는 Tensor에 대하여 사칙 연산을 수행해야 할 필요가 있는 경우에 사용됨
- PyTorch에서는 자동으로 크기를 맞추어 연산을 수행하게 만드는 기능 제공