提交 1192e800 authored 作者: Frederic Bastien's avatar Frederic Bastien

Use the normal way of getting a test. I think we should refactor the code to…

Use the normal way of getting a test. I think we should refactor the code to have a get_default_mode_c() method or give a parameter to get_default_mode(c=False).
上级 0b5759af
from __future__ import absolute_import, print_function, division
import copy
import numpy
import theano
......@@ -14,14 +12,12 @@ from .config import mode_with_gpu, mode_without_gpu, test_ctx_name
def get_mode(gpu):
mode = get_default_mode()
mode = copy.copy(mode)
if theano.config.mode == 'FAST_COMPILE':
mode = theano.compile.get_mode('FAST_RUN')
if gpu:
mode = mode.including('gpuarray', 'gpu_local_optimizations',
'local_cut_gpu_host_gpu')
if isinstance(mode.linker, theano.gof.PerformLinker):
mode.linker = predefined_linkers['c|py']
if hasattr(mode.linker, 'c_thunks'):
mode.linker.c_thunks = True
'local_cut_gpu_host_gpu',
'local_gpu_multinomial')
return mode
......
from __future__ import absolute_import, print_function, division
import copy
import os
import sys
from six import reraise
......@@ -19,15 +18,12 @@ from theano.misc.pkl_utils import CompatUnpickler
def get_mode(gpu):
mode = get_default_mode()
mode = copy.copy(mode)
if theano.config.mode == 'FAST_COMPILE':
mode = theano.compile.get_mode('FAST_RUN')
if gpu:
mode = mode.including('gpu', 'gpu_local_optimizations',
'local_cut_gpu_host_gpu',
'local_gpu_multinomial')
if isinstance(mode.linker, theano.gof.PerformLinker):
mode.linker = predefined_linkers['c|py']
if hasattr(mode.linker, 'c_thunks'):
mode.linker.c_thunks = True
return mode
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论