提交 476c7b07 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

test.npy file generated in compiledir

上级 fe0e524d
import unittest import unittest
import theano
from theano import tensor, function, Variable, Generic from theano import tensor, function, Variable, Generic
import numpy import numpy
class T_load_tensor(unittest.TestCase): class T_load_tensor(unittest.TestCase):
def test0(self): def test0(self):
data = numpy.arange(5, dtype=numpy.int32) data = numpy.arange(5, dtype=numpy.int32)
filename = "_load_tensor_test_1.npy" filename = theano.config.base_compiledir+"/_test.npy"
numpy.save(filename, data) numpy.save(filename, data)
path = Variable(Generic()) path = Variable(Generic())
x = tensor.load(path, 'int32', (False,)) x = tensor.load(path, 'int32', (False,))
...@@ -14,7 +15,7 @@ class T_load_tensor(unittest.TestCase): ...@@ -14,7 +15,7 @@ class T_load_tensor(unittest.TestCase):
assert (fn(filename) == data*2).all() assert (fn(filename) == data*2).all()
def test_memmap(self): def test_memmap(self):
data = numpy.arange(5, dtype=numpy.int32) data = numpy.arange(5, dtype=numpy.int32)
filename = "_load_tensor_test_1.npy" filename = theano.config.base_compiledir+"/_test.npy"
numpy.save(filename, data) numpy.save(filename, data)
path = Variable(Generic()) path = Variable(Generic())
x = tensor.load(path, 'int32', (False,), mmap_mode='r+') x = tensor.load(path, 'int32', (False,), mmap_mode='r+')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论