提交 98c29e37 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

using os.path.join for windows compatibility

上级 476c7b07
...@@ -2,11 +2,12 @@ import unittest ...@@ -2,11 +2,12 @@ import unittest
import theano import theano
from theano import tensor, function, Variable, Generic from theano import tensor, function, Variable, Generic
import numpy import numpy
import os
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 = theano.config.base_compiledir+"/_test.npy" filename = os.path.join(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,))
...@@ -15,7 +16,7 @@ class T_load_tensor(unittest.TestCase): ...@@ -15,7 +16,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 = theano.config.base_compiledir+"/_test.npy" filename = os.path.join(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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论