提交 4017cf0f authored 作者: sebastien-j's avatar sebastien-j

check_py->check_py_code (and copy)

上级 d206cebe
import unittest import unittest
import numpy import numpy
import copy
import theano import theano
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
...@@ -188,11 +189,11 @@ class TestConv3dFFT(unittest.TestCase): ...@@ -188,11 +189,11 @@ class TestConv3dFFT(unittest.TestCase):
pad_last_dim = pad) pad_last_dim = pad)
conv_fft = conv_fft.dimshuffle(0, 2, 3, 4, 1) conv_fft = conv_fft.dimshuffle(0, 2, 3, 4, 1)
ref_mode = theano.compile.get_default_mode() ref_mode = copy.copy(theano.compile.get_default_mode())
ref_mode.check_py = False ref_mode.check_py_code = False
f_ref = theano.function([], conv_ref, mode=ref_mode) f_ref = theano.function([], conv_ref, mode=ref_mode)
mode = mode_with_gpu mode = mode_with_gpu
mode.check_py = False mode.check_py_code = False
f_fft = theano.function([], conv_fft, mode=mode) f_fft = theano.function([], conv_fft, mode=mode)
res_ref = f_ref() res_ref = f_ref()
...@@ -255,10 +256,10 @@ class TestConv3dFFT(unittest.TestCase): ...@@ -255,10 +256,10 @@ class TestConv3dFFT(unittest.TestCase):
conv = theano.tensor.nnet.conv3D(V=inputs, W=filters, conv = theano.tensor.nnet.conv3D(V=inputs, W=filters,
b=bias, d=(1,1,1)) b=bias, d=(1,1,1))
ref_mode = theano.compile.get_default_mode() ref_mode = copy.copy(theano.compile.get_default_mode())
ref_mode.check_py = False ref_mode.check_py_code = False
mode = mode_with_gpu.including('conv3d_fft') mode = mode_with_gpu.including('conv3d_fft')
mode.check_py = False mode.check_py_code = False
f_ref = theano.function([], conv, mode=ref_mode) f_ref = theano.function([], conv, mode=ref_mode)
f_fft = theano.function([], conv, mode=mode) f_fft = theano.function([], conv, mode=mode)
...@@ -288,10 +289,10 @@ class TestConv3dFFT(unittest.TestCase): ...@@ -288,10 +289,10 @@ class TestConv3dFFT(unittest.TestCase):
conv = theano.tensor.nnet.convGrad3D(V=inputs, dCdH=dCdH, conv = theano.tensor.nnet.convGrad3D(V=inputs, dCdH=dCdH,
WShape=filters_shape, WShape=filters_shape,
d=(1,1,1)) d=(1,1,1))
ref_mode = theano.compile.get_default_mode() ref_mode = copy.copy(theano.compile.get_default_mode())
ref_mode.check_py = False ref_mode.check_py_code = False
mode = mode_with_gpu.including('convgrad3d_fft') mode = mode_with_gpu.including('convgrad3d_fft')
mode.check_py = False mode.check_py_code = False
f_ref = theano.function([], conv, mode=ref_mode) f_ref = theano.function([], conv, mode=ref_mode)
f_fft = theano.function([], conv, mode=mode) f_fft = theano.function([], conv, mode=mode)
......
import unittest import unittest
import numpy import numpy
import copy
import theano import theano
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
...@@ -172,9 +173,9 @@ class TestCorr3DMM(unittest.TestCase): ...@@ -172,9 +173,9 @@ class TestCorr3DMM(unittest.TestCase):
conv = theano.tensor.nnet.conv3D(V=inputs, W=filters, conv = theano.tensor.nnet.conv3D(V=inputs, W=filters,
b=bias, d=(1, 1, 1)) b=bias, d=(1, 1, 1))
mode = mode_with_gpu.including('conv3d_gemm') mode = mode_with_gpu.including('conv3d_gemm')
mode.check_py = False mode.check_py_code = False
ref_mode = theano.compile.get_default_mode() ref_mode = copy.copy(theano.compile.get_default_mode())
ref_mode.check_py = False ref_mode.check_py_code = False
f_ref = theano.function([], conv, mode=ref_mode) f_ref = theano.function([], conv, mode=ref_mode)
f_gemm = theano.function([], conv, mode=mode) f_gemm = theano.function([], conv, mode=mode)
......
import os import os
import sys import sys
import time import time
import copy
import numpy import numpy
import theano import theano
...@@ -322,8 +323,8 @@ def test_GPU_nstreams_limit(): ...@@ -322,8 +323,8 @@ def test_GPU_nstreams_limit():
if theano.config.mode == "FAST_COMPILE": if theano.config.mode == "FAST_COMPILE":
mode = "FAST_RUN" mode = "FAST_RUN"
else: else:
mode = theano.compile.get_default_mode() mode = copy.copy(theano.compile.get_default_mode())
mode.check_py = False mode.check_py_code = False
out = R.uniform(size=size, nstreams=nstreams, dtype='float32') out = R.uniform(size=size, nstreams=nstreams, dtype='float32')
f = theano.function([], out, mode=mode) f = theano.function([], out, mode=mode)
return f() return f()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论