提交 c5ce82e7 authored 作者: Olivier Mastropietro's avatar Olivier Mastropietro

Fixed import * errors. Removed if 0 test. Removed compile/tests/* from the whitelist

上级 9805ceaa
...@@ -8,8 +8,9 @@ from theano.tensor import dmatrix, iscalar, lscalar, dmatrices ...@@ -8,8 +8,9 @@ from theano.tensor import dmatrix, iscalar, lscalar, dmatrices
from theano import tensor from theano import tensor
from theano.compile import In from theano.compile import In
from theano.compile.sharedvalue import * from theano.compile import pfunc
from theano.compile.pfunc import * from theano.compile import shared
from theano.compile import config
def data_of(s): def data_of(s):
......
...@@ -3,27 +3,21 @@ import unittest ...@@ -3,27 +3,21 @@ import unittest
import theano import theano
from theano.tensor import Tensor, TensorType from theano.tensor import Tensor, TensorType
from theano.compile.sharedvalue import * from theano.compile.sharedvalue import shared
from theano.compile.sharedvalue import SharedVariable
from theano.compile.sharedvalue import generic
class Test_SharedVariable(unittest.TestCase): class Test_SharedVariable(unittest.TestCase):
def test_ctors(self): def test_ctors(self):
if 0: if theano.configdefaults.python_int_bitwidth() == 32:
# when using an implementation that handles scalars with assert shared(7).type == theano.tensor.iscalar, shared(7).type
# Scalar type
assert shared(7).type == Scalar('int64')
assert shared(7.0).type == Scalar('float64')
assert shared(7, dtype='float64').type == Scalar('float64')
else: else:
if theano.configdefaults.python_int_bitwidth() == 32: assert shared(7).type == theano.tensor.lscalar, shared(7).type
assert shared(7).type == theano.tensor.iscalar, shared(7).type assert shared(7.0).type == theano.tensor.dscalar
else: assert shared(numpy.float32(7)).type == theano.tensor.fscalar
assert shared(7).type == theano.tensor.lscalar, shared(7).type
assert shared(7.0).type == theano.tensor.dscalar
assert shared(numpy.float32(7)).type == theano.tensor.fscalar
# test tensor constructor # test tensor constructor
b = shared(numpy.zeros((5, 5), dtype='int32')) b = shared(numpy.zeros((5, 5), dtype='int32'))
......
...@@ -42,15 +42,6 @@ whitelist_flake8 = [ ...@@ -42,15 +42,6 @@ whitelist_flake8 = [
"tests/unittest_tools.py", "tests/unittest_tools.py",
"compile/__init__.py", "compile/__init__.py",
"compile/profiling.py", "compile/profiling.py",
"compile/tests/test_builders.py",
"compile/tests/test_misc.py",
"compile/tests/test_monitormode.py",
"compile/tests/test_function_module.py",
"compile/tests/test_shared.py",
"compile/tests/test_ops.py",
"compile/tests/test_pfunc.py",
"compile/tests/test_debugmode.py",
"compile/tests/test_profiling.py",
"typed_list/__init__.py", "typed_list/__init__.py",
"tensor/__init__.py", "tensor/__init__.py",
"tensor/tests/test_subtensor.py", "tensor/tests/test_subtensor.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论