Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
394857d6
提交
394857d6
authored
8月 14, 2017
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add shortcut theano.change_flags and use it.
上级
682ce237
隐藏空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
27 行增加
和
30 行删除
+27
-30
__init__.py
theano/__init__.py
+1
-0
builders.py
theano/compile/builders.py
+2
-2
debugmode.py
theano/compile/debugmode.py
+1
-1
function_module.py
theano/compile/function_module.py
+1
-1
test_builders.py
theano/compile/tests/test_builders.py
+1
-1
test_debugmode.py
theano/compile/tests/test_debugmode.py
+1
-1
test_destroyhandler.py
theano/gof/tests/test_destroyhandler.py
+1
-1
test_opt.py
theano/gof/tests/test_opt.py
+1
-1
type.py
theano/gof/type.py
+2
-3
test_opt.py
theano/gpuarray/tests/test_opt.py
+2
-2
test_rng_mrg.py
theano/gpuarray/tests/test_rng_mrg.py
+1
-2
test_subtensor.py
theano/gpuarray/tests/test_subtensor.py
+1
-1
rng_mrg.py
theano/sandbox/rng_mrg.py
+1
-1
test_rng_mrg.py
theano/sandbox/tests/test_rng_mrg.py
+1
-3
test_scan.py
theano/scan_module/tests/test_scan.py
+2
-2
elemwise.py
theano/tensor/elemwise.py
+1
-1
bn.py
theano/tensor/nnet/bn.py
+1
-1
test_abstract_conv.py
theano/tensor/nnet/tests/test_abstract_conv.py
+1
-1
test_neighbours.py
theano/tensor/nnet/tests/test_neighbours.py
+1
-1
test_basic.py
theano/tensor/tests/test_basic.py
+1
-1
test_mpi.py
theano/tensor/tests/test_mpi.py
+1
-1
test_opt.py
theano/tensor/tests/test_opt.py
+1
-1
test_subtensor.py
theano/tensor/tests/test_subtensor.py
+1
-1
没有找到文件。
theano/__init__.py
浏览文件 @
394857d6
...
...
@@ -65,6 +65,7 @@ def disable_log_handler(logger=theano_logger, handler=logging_default_handler):
from
theano.version
import
version
as
__version__
from
theano.configdefaults
import
config
from
theano.configparser
import
change_flags
# This is the api version for ops that generate C code. External ops
# might need manual changes if this number goes up. An undefined
...
...
theano/compile/builders.py
浏览文件 @
394857d6
...
...
@@ -271,7 +271,7 @@ class OpFromGraph(gof.Op):
is_inline
=
self
.
is_inline
return
'
%(name)
s{inline=
%(is_inline)
s}'
%
locals
()
@theano.c
onfigparser.c
hange_flags
(
compute_test_value
=
'off'
)
@theano.change_flags
(
compute_test_value
=
'off'
)
def
_recompute_grad_op
(
self
):
'''
converts self._grad_op from user supplied form to type(self) instance
...
...
@@ -375,7 +375,7 @@ class OpFromGraph(gof.Op):
self
.
_grad_op_stypes_l
=
all_grads_ov_l
self
.
_grad_op_is_cached
=
True
@theano.c
onfigparser.c
hange_flags
(
compute_test_value
=
'off'
)
@theano.change_flags
(
compute_test_value
=
'off'
)
def
_recompute_rop_op
(
self
):
'''
converts self._rop_op from user supplied form to type(self) instance
...
...
theano/compile/debugmode.py
浏览文件 @
394857d6
...
...
@@ -28,7 +28,7 @@ from theano.compile.function_module import (
std_fgraph
)
from
theano.compile.mode
import
Mode
,
register_mode
from
theano.compile.ops
import
OutputGuard
,
_output_guard
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
__docformat__
=
"restructuredtext en"
...
...
theano/compile/function_module.py
浏览文件 @
394857d6
...
...
@@ -1829,7 +1829,7 @@ def orig_function(inputs, outputs, mode=None, accept_inplace=False,
on_unused_input
=
on_unused_input
,
output_keys
=
output_keys
,
name
=
name
)
with
theano
.
c
onfigparser
.
c
hange_flags
(
compute_test_value
=
"off"
):
with
theano
.
change_flags
(
compute_test_value
=
"off"
):
fn
=
m
.
create
(
defaults
)
finally
:
t2
=
time
.
time
()
...
...
theano/compile/tests/test_builders.py
浏览文件 @
394857d6
...
...
@@ -315,7 +315,7 @@ class T_OpFromGraph(unittest_tools.InferShapeTester):
np
.
ones
([
3
,
4
],
dtype
=
config
.
floatX
)],
OpFromGraph
)
@theano.c
onfigparser.c
hange_flags
(
compute_test_value
=
'raise'
)
@theano.change_flags
(
compute_test_value
=
'raise'
)
def
test_compute_test_value
(
self
):
x
=
T
.
scalar
(
'x'
)
x
.
tag
.
test_value
=
np
.
array
(
1.
,
dtype
=
config
.
floatX
)
...
...
theano/compile/tests/test_debugmode.py
浏览文件 @
394857d6
...
...
@@ -284,7 +284,7 @@ def test_badoptimization_opt_err():
# Test that opt that do an illegal change still get the error from gof.
try
:
with
theano
.
c
onfigparser
.
c
hange_flags
(
on_opt_error
=
'raise'
):
with
theano
.
change_flags
(
on_opt_error
=
'raise'
):
f2
=
theano
.
function
([
a
,
b
],
a
+
b
,
mode
=
debugmode
.
DebugMode
(
optimizer
=
opt2
,
stability_patience
=
1
))
...
...
theano/gof/tests/test_destroyhandler.py
浏览文件 @
394857d6
...
...
@@ -12,7 +12,7 @@ from theano.gof import destroyhandler
from
theano.gof.fg
import
FunctionGraph
,
InconsistencyError
from
theano.gof.toolbox
import
ReplaceValidate
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
from
copy
import
copy
...
...
theano/gof/tests/test_opt.py
浏览文件 @
394857d6
...
...
@@ -571,7 +571,7 @@ class TestEquilibrium(object):
opt
.
optimize
(
g
)
assert
str
(
g
)
==
'[Op2(x, y)]'
@theano.c
onfigparser.c
hange_flags
(
on_opt_error
=
'ignore'
)
@theano.change_flags
(
on_opt_error
=
'ignore'
)
def
test_low_use_ratio
(
self
):
x
,
y
,
z
=
map
(
MyVariable
,
'xyz'
)
e
=
op3
(
op4
(
x
,
y
))
...
...
theano/gof/type.py
浏览文件 @
394857d6
...
...
@@ -12,10 +12,9 @@ from six import string_types
import
re
import
theano
from
theano.gof
import
utils
from
theano.gof
import
graph
,
utils
from
theano.gof.utils
import
MethodNotDefined
,
object2
from
theano.gof
import
graph
from
theano.configparser
import
change_flags
from
theano
import
change_flags
########
# Type #
...
...
theano/gpuarray/tests/test_opt.py
浏览文件 @
394857d6
...
...
@@ -283,7 +283,7 @@ class test_gpu_ifelse(test_ifelse.test_ifelse):
z
=
tensor
.
constant
(
2.
)
a
=
theano
.
ifelse
.
ifelse
(
x
,
y
,
z
)
with
theano
.
c
onfigparser
.
c
hange_flags
(
on_opt_error
=
'raise'
):
with
theano
.
change_flags
(
on_opt_error
=
'raise'
):
theano
.
function
([
x
],
[
a
],
mode
=
mode_with_gpu
)
...
...
@@ -516,7 +516,7 @@ def test_not_useless_scalar_gpuelemwise():
# We don't want to move elemwise on scalar on the GPU when the
# result will not be used on the GPU!
with
theano
.
c
onfigparser
.
c
hange_flags
(
warn_float64
=
'ignore'
):
with
theano
.
change_flags
(
warn_float64
=
'ignore'
):
X
=
tensor
.
fmatrix
()
x
=
np
.
random
.
randn
(
32
,
32
)
.
astype
(
np
.
float32
)
m1
=
theano
.
shared
(
np
.
random
.
randn
(
32
,
32
)
.
astype
(
np
.
float32
))
...
...
theano/gpuarray/tests/test_rng_mrg.py
浏览文件 @
394857d6
...
...
@@ -4,8 +4,7 @@ import functools
import
numpy
as
np
import
theano
from
theano
import
tensor
from
theano.configparser
import
change_flags
from
theano
import
change_flags
,
tensor
from
theano.sandbox
import
rng_mrg
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
from
theano.sandbox.tests.test_rng_mrg
import
java_samples
,
rng_mrg_overflow
...
...
theano/gpuarray/tests/test_subtensor.py
浏览文件 @
394857d6
...
...
@@ -123,7 +123,7 @@ def test_advinc_subtensor1_dtype():
assert
np
.
allclose
(
rval
,
rep
)
@theano.c
onfigparser.c
hange_flags
(
deterministic
=
'more'
)
@theano.change_flags
(
deterministic
=
'more'
)
def
test_deterministic_flag
():
shp
=
(
3
,
4
)
for
dtype1
,
dtype2
in
[(
'float32'
,
'int8'
)]:
...
...
theano/sandbox/rng_mrg.py
浏览文件 @
394857d6
...
...
@@ -754,7 +754,7 @@ class MRG_RandomStreams(object):
self
.
rstate
=
multMatVect
(
self
.
rstate
,
A1p134
,
M1
,
A2p134
,
M2
)
assert
self
.
rstate
.
dtype
==
np
.
int32
@theano.c
onfigparser.c
hange_flags
(
compute_test_value
=
'off'
)
@theano.change_flags
(
compute_test_value
=
'off'
)
def
get_substream_rstates
(
self
,
n_streams
,
dtype
,
inc_rstate
=
True
):
# TODO : need description for parameter and return
"""
...
...
theano/sandbox/tests/test_rng_mrg.py
浏览文件 @
394857d6
...
...
@@ -9,14 +9,12 @@ import numpy as np
from
six.moves
import
xrange
import
theano
from
theano
import
tensor
,
config
from
theano
import
change_flags
,
config
,
tensor
from
theano.sandbox
import
rng_mrg
from
theano.sandbox.rng_mrg
import
MRG_RandomStreams
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests.unittest_tools
import
attr
from
theano.configparser
import
change_flags
# TODO: test MRG_RandomStreams
# Partly done in test_consistency_randomstreams
...
...
theano/scan_module/tests/test_scan.py
浏览文件 @
394857d6
...
...
@@ -2790,7 +2790,7 @@ class T_Scan(unittest.TestCase):
utt
.
assert_allclose
(
expected_output
,
scan_output
)
utt
.
assert_allclose
(
expected_output
,
jacobian_outputs
)
@theano.c
onfigparser.c
hange_flags
(
on_opt_error
=
'raise'
)
@theano.change_flags
(
on_opt_error
=
'raise'
)
def
test_pushout_seqs2
(
self
):
# This test for a bug with PushOutSeqScan that was reported on the
# theano-user mailing list where the optimization raised an exception
...
...
@@ -2807,7 +2807,7 @@ class T_Scan(unittest.TestCase):
# an exception being raised
theano
.
function
([
x
],
outputs
,
updates
=
updates
)
@theano.c
onfigparser.c
hange_flags
(
on_opt_error
=
'raise'
)
@theano.change_flags
(
on_opt_error
=
'raise'
)
def
test_pushout_nonseq
(
self
):
# Test case originally reported by Daniel Renshaw. The crashed occured
# during the optimization PushOutNonSeqScan when it attempted to
...
...
theano/tensor/elemwise.py
浏览文件 @
394857d6
...
...
@@ -8,7 +8,7 @@ from six.moves import xrange
import
theano
from
theano
import
gof
from
theano.compat
import
izip
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
from
theano.gof
import
Apply
,
Op
,
COp
,
OpenMPOp
,
ParamsType
from
theano
import
scalar
from
theano.scalar
import
get_scalar_type
...
...
theano/tensor/nnet/bn.py
浏览文件 @
394857d6
...
...
@@ -14,7 +14,7 @@ from theano.scalar import add, sub, true_div, mul
class
BNComposite
(
Composite
):
init_param
=
(
'dtype'
,)
@theano.c
onfigparser.c
hange_flags
(
compute_test_value
=
'off'
)
@theano.change_flags
(
compute_test_value
=
'off'
)
def
__init__
(
self
,
dtype
):
self
.
dtype
=
dtype
x
=
theano
.
scalar
.
Scalar
(
dtype
=
dtype
)
.
make_variable
()
...
...
theano/tensor/nnet/tests/test_abstract_conv.py
浏览文件 @
394857d6
...
...
@@ -6,7 +6,7 @@ from nose.tools import assert_raises, assert_true
import
theano
from
theano
import
tensor
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
from
theano.gof.opt
import
check_stack_trace
from
theano.tests
import
unittest_tools
as
utt
from
theano.tensor.nnet
import
(
corr
,
corr3d
,
conv2d_transpose
,
...
...
theano/tensor/nnet/tests/test_neighbours.py
浏览文件 @
394857d6
...
...
@@ -8,7 +8,7 @@ import theano.tensor as T
from
theano.tensor.nnet.neighbours
import
images2neibs
,
neibs2images
,
Images2Neibs
from
theano.tests
import
unittest_tools
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
mode_without_gpu
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'gpu'
)
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
394857d6
...
...
@@ -57,7 +57,7 @@ from theano.tensor import (
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests.unittest_tools
import
attr
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
imported_scipy_special
=
False
mode_no_scipy
=
get_default_mode
()
...
...
theano/tensor/tests/test_mpi.py
浏览文件 @
394857d6
...
...
@@ -6,7 +6,7 @@ import subprocess
import
os
from
theano.gof.sched
import
sort_schedule_fn
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
mpi_scheduler
=
sort_schedule_fn
(
*
mpi_cmps
)
mpi_linker
=
theano
.
OpWiseCLinker
(
schedule
=
mpi_scheduler
)
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
394857d6
...
...
@@ -63,7 +63,7 @@ from theano.tensor.elemwise import DimShuffle
from
theano.tensor.type
import
values_eq_approx_remove_nan
from
theano.tests
import
unittest_tools
as
utt
from
theano.gof.opt
import
check_stack_trace
,
out2in
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
from
nose.plugins.attrib
import
attr
mode_opt
=
theano
.
config
.
mode
...
...
theano/tensor/tests/test_subtensor.py
浏览文件 @
394857d6
...
...
@@ -34,7 +34,7 @@ from theano.tensor.subtensor import (AdvancedIncSubtensor,
from
theano.tensor.tests.test_basic
import
inplace_func
,
rand
,
randint_ranged
from
theano.tests
import
unittest_tools
as
utt
from
theano.tests.unittest_tools
import
attr
from
theano
.configparser
import
change_flags
from
theano
import
change_flags
if
PY3
:
def
L
(
i
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论