Created
July 11, 2016 10:50
-
-
Save unnonouno/a53031262b80a9d506c2c3c8bef8d7ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import chainer | |
from chainer import cuda | |
import cupy | |
import numpy | |
import time | |
ls = numpy.random.randint(1, 100, size=1000) | |
ls = numpy.sort(ls)[::-1] | |
unit = 100 | |
xs = [cupy.empty((l, unit), 'f') for l in ls] | |
cuda.to_cpu(xs[0]) | |
begin = time.time() | |
for i in range(10): | |
chainer.functions.transpose_sequence(xs) | |
cuda.to_cpu(xs[0]) | |
end = time.time() | |
print(end - begin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment