https://pytorch.org/docs/stable/generated/torch.Tensor.masked_fill_.html
torch.Tensor.masked_fill_ — PyTorch 2.5 documentation
Shortcuts
pytorch.org
공식 document에 따르면 `torch.Tensor.masked_fill_`의 구버전으로,
`Tensor.masked_fill_(mask, value)`의 형태로 사용 가능하다.
`mask`에 해당되는 Tensor의 값을 `value`로 바꿔 return시켜주는 메소드이다.
'TIL' 카테고리의 다른 글
[Python] GPU 사용량 확인 (0) | 2024.12.11 |
---|---|
[Python] 함수의 인자 전달 시, 인자 값의 변경 (0) | 2024.11.22 |
[Pytorch] GPU elapsed time / torch.cuda.Event() (0) | 2024.08.12 |
[Pytorch] torch.Tensor.expand() & torch.Tensor.repeat() (0) | 2024.08.05 |
[Pytorch] Contiguous (0) | 2024.07.31 |