提交 01266e11 authored 作者: amrithasuresh's avatar amrithasuresh

1. Updated numpy as np

2. Fixed indentation
上级 e13741a1
...@@ -2,17 +2,17 @@ from __future__ import absolute_import, print_function, division ...@@ -2,17 +2,17 @@ from __future__ import absolute_import, print_function, division
import unittest import unittest
import theano import theano
from theano import tensor, function, Variable, Generic from theano import tensor, function, Variable, Generic
import numpy import numpy as np
import os import os
class T_load_tensor(unittest.TestCase): class T_load_tensor(unittest.TestCase):
def setUp(self): def setUp(self):
self.data = numpy.arange(5, dtype=numpy.int32) self.data = np.arange(5, dtype=np.int32)
self.filename = os.path.join( self.filename = os.path.join(
theano.config.compiledir, theano.config.compiledir,
"_test.npy") "_test.npy")
numpy.save(self.filename, self.data) np.save(self.filename, self.data)
def test0(self): def test0(self):
path = Variable(Generic()) path = Variable(Generic())
...@@ -49,7 +49,7 @@ class T_load_tensor(unittest.TestCase): ...@@ -49,7 +49,7 @@ class T_load_tensor(unittest.TestCase):
path = Variable(Generic()) path = Variable(Generic())
x = tensor.load(path, 'int32', (False,), mmap_mode='c') x = tensor.load(path, 'int32', (False,), mmap_mode='c')
fn = function([path], x) fn = function([path], x)
assert type(fn(self.filename)) == numpy.core.memmap assert type(fn(self.filename)) == np.core.memmap
def tearDown(self): def tearDown(self):
os.remove(os.path.join( os.remove(os.path.join(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论