machine learning/pytorch
[pytorch] Variable -> tensor 로 통합
단창
2020. 8. 21. 18:17
- 원래 Variable는 tensor의 warpper 였음. tensor는 history tracking 이 안되고 variable는 되었었는데 이제 tensor가 가능함
- linux 에서 돌아가던 code를 win10에서 돌리니 이런 에러발생
RuntimeError: Expected tensor for argument #1 ‘indices’ to have scalar type Long
선언된 Variable이 int.32 타입임 int.64로 바꿔줘야함.
a= Variable(~~~)
이던것을 a = torch.tensor(~~~,dtype =torch.int64 )
로 바꿔줌
반응형