提交 f39431ff authored 作者: Vikram's avatar Vikram

Minor changes

上级 58c3d08e
......@@ -2135,7 +2135,7 @@ class ConvMetaOptimizer(LocalMetaOptimizer):
node.op.subsample,
node.op.filter_dilation)
result[kshape] = theano.tensor.as_tensor_variable(node.op.kshp[2:])
result[kshape] = theano.tensor.as_tensor_variable(node.op.kshp[-2:])
for(var, shape) in zip((img, top), (node.op.imshp, tshp)):
result[var] = theano.shared(np.random.random(shape).astype(var.dtype),
......
......@@ -8,9 +8,9 @@ from theano.tests import unittest_tools as utt
from theano.tensor.nnet.corr import CorrMM, CorrMM_gradWeights, CorrMM_gradInputs
from theano.gpuarray.type import gpuarray_shared_constructor
from theano.gpuarray.blas import GpuCorrMM, GpuCorrMM_gradWeights, GpuCorrMM_gradInputs
from config import mode_with_gpu, mode_without_gpu, ref_cast
from ..type import gpuarray_shared_constructor
from ..blas import GpuCorrMM, GpuCorrMM_gradWeights, GpuCorrMM_gradInputs
from .config import mode_with_gpu, mode_without_gpu, ref_cast
from theano.tensor.nnet.tests.test_abstract_conv import Grouped_conv_noOptim, TestUnsharedConv
......
......@@ -1754,9 +1754,9 @@ class TestUnsharedConv(unittest.TestCase):
conv2d_gradw_op = theano.tensor.nnet.abstract_conv.AbstractConv2d_gradWeights
conv2d_gradi_op = theano.tensor.nnet.abstract_conv.AbstractConv2d_gradInputs
def setUp(self):
self.mode = theano.compile.mode.Mode(optimizer='None')
mode = theano.compile.mode.Mode(optimizer='None')
def setUp(self):
self.img_shape = [(2, 1, 4, 4), (1, 2, 4, 2), (1, 3, 5, 3), (1, 4, 4, 4)]
self.kern_shape = [(2, 2, 2, 1, 3, 3), (2, 4, 2, 2, 4, 2), (3, 2, 1, 1, 3, 3), (4, 3, 3, 2, 4, 2)]
self.topgrad_shape = [(2, 2, 2, 2), (1, 2, 4, 2), (1, 3, 2, 1), (1, 4, 3, 3)]
......@@ -1765,7 +1765,9 @@ class TestUnsharedConv(unittest.TestCase):
self.filter_dilation = (1, 1)
self.num_groups = [1, 1, 3, 2]
self.verify_flags = np.random.choice([True, False], 4, [1.0, 0.0])
# self.verify_flags = np.random.choice([True, False], 4, [0.5, 0.5])
# Above line can be used instead if speed is a concern
self.verify_flags = [True] * 4
self.ref_mode = 'FAST_RUN'
if theano.config.cxx == "":
......
......@@ -452,9 +452,9 @@ class TestGroupCorr2d(Grouped_conv_noOptim):
utt.assert_allclose(gconv_output, conv_output)
class TestUnsharedCorr2D(TestUnsharedConv):
class TestUnsharedCorr2d(TestUnsharedConv):
if theano.config.mode == "FAST_COMPILE":
mode = theano.compile.get_mode("FAST_RUN").excluding('gpuarray')
mode = theano.compile.get_mode("FAST_RUN")
else:
mode = None
conv2d = corr.CorrMM
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论