torch.cat()

SeungHyun·2024년 4월 17일
0

pytorch

목록 보기
6/8
post-thumbnail

아래 내용은 pytorch 2.1.0 버전으로 작성됨.

0. 바로 사용하기

torch.cat((tensor1, tensor2, tensor3), dim=0)
  • (tensor1, tensor2, tensor3): 연결할 텐서들
  • dim=0: 연결할 차원


1. 기본형

torch.cat(tensors, dim=0, *, out=None) → Tensor


2. 기능

  • 입력 받은 tensor들을 입력 받은 차원에 따라 결합한 tensor를 반환함.


3. 파라미터

tensors

  • tensors: 연결할 tensor
    • 결합하려는 차원의 tensor.shape은 일치해야함.

dim

  • dim = integer: tensor들을 연결할 기준 차원


ref

profile
어디로 가야하오

0개의 댓글

관련 채용 정보