提交 5ca9ce17 authored 作者: Nicolas Ballas's avatar Nicolas Ballas

remove deprecated tests in tensor.nnet.tests.test_conv and update flake8

上级 0a45a709
......@@ -2,16 +2,14 @@
Define abstract conv2d interface
"""
__docformat__ = "restructuredtext en"
import logging
import theano
from theano.tensor import (as_tensor_variable, patternbroadcast)
from theano.tensor import TensorType
from theano.tensor import as_tensor_variable
from theano.gof import Apply, Op
__docformat__ = "restructuredtext en"
_logger = logging.getLogger("theano.tensor.nnet.conv2d")
......@@ -170,7 +168,6 @@ def conv2d(input,
return conv_op(input, filters)
class BaseAbstractConv2d(Op):
"""
Base class for AbstractConv
......
......@@ -450,29 +450,6 @@ class TestConv2D(utt.InferShapeTester):
print(t2 - t1, end=' ')
print()
def test_fail(self):
k = theano.shared(numpy.ones((1, 1, 3, 3), dtype='float32'))
im = T.ftensor4()
out = theano.function([im],
T.nnet.conv2d(im, k, image_shape=(1, 1, 10, 10)))
self.assertRaises(ValueError, out, numpy.ones((1, 1, 20, 10),
dtype='float32'))
out = theano.function([im],
T.nnet.conv2d(im, k, filter_shape=(1, 1, 3, 2)))
self.assertRaises(ValueError, out, numpy.ones((1, 1, 10, 10),
dtype='float32'))
out = theano.function([im],
T.nnet.conv2d(im, k, filter_shape=(2, None,
None, None)))
self.assertRaises(ValueError, out, numpy.ones((1, 1, 10, 10),
dtype='float32'))
out = theano.function([im],
T.nnet.conv2d(im, k, image_shape=(1, None,
None, None)))
self.assertRaises(ValueError, out, numpy.ones((2, 1, 10, 10),
dtype='float32'))
def test_infer_shape(self):
# Note: infer_shape is incomplete and thus input and filter shapes
# must be provided explicitly
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论