projects
/
flatland.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Update.
[flatland.git]
/
test.py
1
#!/usr/bin/env python-for-pytorch
2
3
import torch
4
import torchvision
5
from torchvision import datasets
6
7
from _ext import mylib
8
9
x = torch.ByteTensor(4, 5).fill_(0)
10
11
print(x.size())
12
13
mylib.generate_sequence(x)
14
15
print(x.size())
16
17
x = x.float().sub_(128).div_(128)
18
19
torchvision.utils.save_image(x[0], 'example.png')