일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- computervision
- 딥러닝
- cs
- Python
- classification
- web
- SSL
- Torch
- REACT
- FGVC
- 알고리즘
- 3d
- pytorch
- FineGrained
- clean code
- dl
- 머신러닝
- nerf
- nlp
- math
- CV
- ML
- algorithm
- PRML
- Vision
- Front
- Meta Learning
- Depth estimation
- GAN
- 자료구조
- Today
- Total
목록Python/Pytorch (10)
KalelPark's LAB

Chunk - Tensor를 지정된 Chunk의 개수로 분할하려고 합니다. 각 Chunk는 입력 텐서의 View이다. - torch.tensor_split()은 항상 명확하게, Chunk하지만, torch.Chunk는 작거나, 같게 합니다. (유연성) import torch chunk_example = torch.arange(12) print(chunk_example) -> tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) print(chunk_example.size()) -> torch.Size([12]) print(chunk_example.chunk(6, dim = -1)) -> (tensor([0, 1]), tensor([2, 3]), tensor([4, 5]),..

torch.nn.Module.register_buffer - parameter가 아니라 buffer를 수행하기 위한 목적으로 활용됩니다. - buffer는 state_dict에 저장되지만, 최적화에 사용되지 않습니다. 즉, 단순한 module이라고 볼 수 있습니다. def register_module(self, name : str, module : Optional["Module"]) -> None: self.add_module(name, module) torch.nn.Module.register_parameter - module에 name을 기반으로 parameter를 추가합니다. - register_buffer와 다르게, 최적화에 사용될 수 있습니다. def register_parameter(self,..