Data Science/Pytorch1 [Pytorch] view, reshape 차이 기존에 구현된 Pytorch 기반의 코드로 분석을 진행하던 중, view 함수 부분에서 다음과 같은 에러가 발생하였습니다. "RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead." 에러에 나타난대로 view 함수를 reshape로 대체하니 에러 없이 잘 진행되었지만, 왜 에러가 발생했는지 정확하게 알기 위해 view와 reshape 함수 간의 차이를 알아보고자 합니다. 1. view, reshape 함수의 기능 우선 두 함수는 numpy 모듈의 reshape .. 2022. 11. 21. 이전 1 다음