"Torch"의 두 판 사이의 차이
ph
잔글 |
잔글 |
||
5번째 줄: | 5번째 줄: | ||
https://github.com/facebook/iTorch<br /> | https://github.com/facebook/iTorch<br /> | ||
ipython같이 쓸 수 있음. | ipython같이 쓸 수 있음. | ||
+ | |||
+ | ==scratch== | ||
+ | Tensor is a particular way of viewing a Storage. <c>storage</c>로 접근하면 내부 배열에 순차적으로 접근 가능. matlab에서 2차원 이상 배열을 1차원배열 index로 접근하는 것과 동일. | ||
+ | <pre>x = torch.Tensor(4,5) | ||
+ | s = x:storage() | ||
+ | for i=1,s:size() do -- fill up the Storage | ||
+ | s[i] = i | ||
+ | end</pre> |
2017년 7월 12일 (수) 14:28 판
links
iTorch
https://github.com/facebook/iTorch
ipython같이 쓸 수 있음.
scratch
Tensor is a particular way of viewing a Storage. storage로 접근하면 내부 배열에 순차적으로 접근 가능. matlab에서 2차원 이상 배열을 1차원배열 index로 접근하는 것과 동일.
x = torch.Tensor(4,5) s = x:storage() for i=1,s:size() do -- fill up the Storage s[i] = i end