본문 바로가기

2020/084

[pytorch] Variable -> tensor 로 통합 - 원래 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 ) 로 바꿔줌 2020. 8. 21.
[pytorch] list of tensors 의 평균구하기 my_list = [tensor(0.8223, device='cuda:0'), tensor(1.8351, device='cuda:0'), tensor(1.4888, device='cuda:0'),] np.mean(my_list) 하면, TypeError: mean(): argument 'input' (position 1) must be Tensor, not list 에러가 난다. 해결> mean = torch.mean(torch.stack(my_list)) 2020. 8. 21.
mathjax 티스토리에 적용하기 관리-> 스킨편집 -> HTML편집에서 사이에 을 넣는다. 사용법은 inline 모드: 백슬래시+소괄호 bs( 수식수식 bs) display 모드: 백슬래시+대괄호 bs[ 수식수식 bs] -테스트 \[ % 메모: (x+1)^2 is NOT x^2 + 1 (x+1)^2 % original expression = (x+1)(x+1) % definition of exponent = x^2 + 2x + 1 % FOIL, combine like terms \] \[7\frac{4}{3} \] \[\frac{x^3+x^2}{t^2-t+1}\] 인라인 모드 테스트. \(7\frac{4}{3}\) 인라인 모드 bs와 괄호로 쌓인 내부에 %로 주석을 넣을 수 있다. 주의점 : - 블로그 기본모드에서 작성해도 상관없지만... 2020. 8. 19.
ubuntu에서 pylint unable to import .. 해결법 https://github.com/dense-analysis/ale/issues/208 pylint import problem with modules in the same folder · Issue #208 · dense-analysis/ale I'm seeing a weird error being reported by pylint only running through ale. As a MWE, I create in an empty folder two files, a.py and b.py and I import a in b.py, as shown in the screenshot. As... github.com .pylintrc 을 ~/ 에 만들어주고 .pylintrc에는 init-hook='import .. 2020. 8. 4.