Code
매일매일 정확히 몰랐던 것을 기록하기
daje
2022. 5. 4. 13:20
728x90
반응형
<양식>
학습 일자 :
학습 내용 :
참조 링크 :
학습 일자 : 2022.05.04
학습 내용 : super()
참조 링크 :

학습 일자 : 2022.05.04(수)
학습 내용
1) clipcap 코드 리뷰 할때 view 함수를 보게 됨
prefix_projections = self.clip_project(prefix).view(-1, self.prefix_length, self.gpt_embedding_size)
2) view 함수
-. 정의 : Returns a new tensor with the same data as the self tensor but of a different shape.
-. example
>>> x = torch.randn(4, 4)
>>> x.size()
torch.Size([4, 4])
>>> y = x.view(16)
>>> y.size()
torch.Size([16])
>>> z = x.view(-1, 8) # the size -1 is inferred from other dimensions
>>> z.size()
torch.Size([2, 8])
3) 참조 링크 : https://pytorch.org/docs/stable/generated/torch.Tensor.view.html
728x90
반응형