Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
690b487a
提交
690b487a
authored
10月 30, 2008
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
a0dbf9c0
130933ce
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
5 行删除
+13
-5
function_module.py
theano/compile/function_module.py
+6
-2
basic.py
theano/tensor/basic.py
+2
-0
opt.py
theano/tensor/opt.py
+3
-2
raw_random.py
theano/tensor/raw_random.py
+2
-1
没有找到文件。
theano/compile/function_module.py
浏览文件 @
690b487a
...
@@ -293,8 +293,12 @@ def _pickle_Function(f):
...
@@ -293,8 +293,12 @@ def _pickle_Function(f):
defaults
=
[]
defaults
=
[]
for
(
input
,
indices
,
inputs
),
(
required
,
refeed
,
default
)
in
zip
(
f
.
indices
,
f
.
defaults
):
for
(
input
,
indices
,
inputs
),
(
required
,
refeed
,
default
)
in
zip
(
f
.
indices
,
f
.
defaults
):
if
isinstance
(
input
,
SymbolicInputKit
):
if
isinstance
(
input
,
SymbolicInputKit
):
defaults
.
append
(
default
)
li
=
len
(
indices
)
ins
[:
len
(
indices
)]
=
[]
if
not
default
:
defaults
.
append
(
ins
[:
li
])
else
:
defaults
.
append
(
default
)
ins
[:
li
]
=
[]
else
:
else
:
defaults
.
append
(
ins
[
0
])
defaults
.
append
(
ins
[
0
])
del
ins
[
0
]
del
ins
[
0
]
...
...
theano/tensor/basic.py
浏览文件 @
690b487a
...
@@ -36,6 +36,8 @@ def check_equal_numpy(x, y):
...
@@ -36,6 +36,8 @@ def check_equal_numpy(x, y):
"""
"""
if
isinstance
(
x
,
numpy
.
ndarray
)
and
isinstance
(
y
,
numpy
.
ndarray
):
if
isinstance
(
x
,
numpy
.
ndarray
)
and
isinstance
(
y
,
numpy
.
ndarray
):
return
x
.
dtype
==
y
.
dtype
and
x
.
shape
==
y
.
shape
and
numpy
.
any
(
abs
(
x
-
y
)
<
1e-10
)
return
x
.
dtype
==
y
.
dtype
and
x
.
shape
==
y
.
shape
and
numpy
.
any
(
abs
(
x
-
y
)
<
1e-10
)
elif
isinstance
(
x
,
numpy
.
random
.
RandomState
)
and
isinstance
(
y
,
numpy
.
random
.
RandomState
):
return
all
(
numpy
.
all
(
a
==
b
)
for
a
,
b
in
zip
(
x
.
__getstate__
(),
y
.
__getstate__
()))
else
:
else
:
return
x
==
y
return
x
==
y
...
...
theano/tensor/opt.py
浏览文件 @
690b487a
...
@@ -23,10 +23,11 @@ def out2in(*local_opts):
...
@@ -23,10 +23,11 @@ def out2in(*local_opts):
order
=
'out_to_in'
,
order
=
'out_to_in'
,
failure_callback
=
lambda
exc
,
opt
,
pairs
:
None
)
failure_callback
=
lambda
exc
,
opt
,
pairs
:
None
)
def
in2out
(
*
local_opts
):
def
in2out
(
*
local_opts
,
**
kwargs
):
return
opt
.
TopoOptimizer
(
opt
.
LocalOptGroup
(
*
local_opts
),
return
opt
.
TopoOptimizer
(
opt
.
LocalOptGroup
(
*
local_opts
),
order
=
'in_to_out'
,
order
=
'in_to_out'
,
failure_callback
=
lambda
exc
,
opt
,
pairs
:
None
)
failure_callback
=
lambda
exc
,
opt
,
pairs
:
None
,
**
kwargs
)
# gemm: (d,a,b,c,s) -> d = d*s + a*dot(b,c)
# gemm: (d,a,b,c,s) -> d = d*s + a*dot(b,c)
...
...
theano/tensor/raw_random.py
浏览文件 @
690b487a
...
@@ -184,8 +184,9 @@ def random_make_inplace(node):
...
@@ -184,8 +184,9 @@ def random_make_inplace(node):
op
=
node
.
op
op
=
node
.
op
if
isinstance
(
op
,
RandomFunction
)
and
not
op
.
inplace
:
if
isinstance
(
op
,
RandomFunction
)
and
not
op
.
inplace
:
return
RandomFunction
(
op
.
fn
,
op
.
outtype
,
*
op
.
args
,
**
dict
(
inplace
=
True
))
.
make_node
(
*
node
.
inputs
)
.
outputs
return
RandomFunction
(
op
.
fn
,
op
.
outtype
,
*
op
.
args
,
**
dict
(
inplace
=
True
))
.
make_node
(
*
node
.
inputs
)
.
outputs
return
False
compile
.
optdb
.
register
(
'random_make_inplace'
,
opt
.
in2out
(
random_make_inplace
),
99
,
'fast_run'
,
'inplace'
)
compile
.
optdb
.
register
(
'random_make_inplace'
,
opt
.
in2out
(
random_make_inplace
,
ignore_newtrees
=
True
),
99
,
'fast_run'
,
'inplace'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论