Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ff7cf542
提交
ff7cf542
authored
5月 25, 2009
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix in elemwise_cgen
上级
546cf660
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
6 行增加
和
8 行删除
+6
-8
elemwise.py
theano/tensor/elemwise.py
+3
-0
elemwise_cgen.py
theano/tensor/elemwise_cgen.py
+1
-1
opt.py
theano/tensor/opt.py
+2
-7
没有找到文件。
theano/tensor/elemwise.py
浏览文件 @
ff7cf542
...
@@ -690,6 +690,9 @@ class CAReduce(Op):
...
@@ -690,6 +690,9 @@ class CAReduce(Op):
return
input_dtype
return
input_dtype
def
make_node
(
self
,
input
):
def
make_node
(
self
,
input
):
for
axis
in
self
.
axis
:
if
axis
>=
input
.
type
.
ndim
:
raise
TypeError
(
'Not enough dimensions on
%
s to reduce on axis
%
s'
%
(
input
,
axis
))
input
=
as_tensor_variable
(
input
)
input
=
as_tensor_variable
(
input
)
axis
=
self
.
axis
axis
=
self
.
axis
if
axis
is
None
:
if
axis
is
None
:
...
...
theano/tensor/elemwise_cgen.py
浏览文件 @
ff7cf542
...
@@ -29,7 +29,7 @@ def make_checks(loop_orders, dtypes, sub):
...
@@ -29,7 +29,7 @@ def make_checks(loop_orders, dtypes, sub):
var
=
"
%%
(lv
%
i)s"
%
i
var
=
"
%%
(lv
%
i)s"
%
i
nonx
=
[
x
for
x
in
loop_order
if
x
!=
'x'
]
nonx
=
[
x
for
x
in
loop_order
if
x
!=
'x'
]
if
nonx
:
if
nonx
:
min_nd
=
max
(
nonx
)
min_nd
=
max
(
nonx
)
+
1
init
+=
"""
init
+=
"""
if (
%(var)
s->nd <
%(min_nd)
s) {
if (
%(var)
s->nd <
%(min_nd)
s) {
PyErr_SetString(PyExc_ValueError, "Not enough dimensions on input.");
PyErr_SetString(PyExc_ValueError, "Not enough dimensions on input.");
...
...
theano/tensor/opt.py
浏览文件 @
ff7cf542
...
@@ -496,13 +496,8 @@ class Canonizer(gof.LocalOptimizer):
...
@@ -496,13 +496,8 @@ class Canonizer(gof.LocalOptimizer):
denum
=
[]
denum
=
[]
parent
=
input
.
owner
parent
=
input
.
owner
# We get the (num, denum) pairs for each input
# We get the (num, denum) pairs for each input (input2) *to* input that has the same
pairs
=
[
self
.
get_num_denum
(
input2
)
if
input2
.
type
.
dtype
==
input
.
type
.
dtype
else
([
input2
],
[])
for
input2
in
parent
.
inputs
]
# type as this one.
pairs
=
[
self
.
get_num_denum
(
input2
)
if
(
getattr
(
input2
.
type
,
'dtype'
,
None
)
==
input
.
type
.
dtype
)
else
([
input2
],
[])
for
input2
in
parent
.
inputs
]
if
parent
.
op
==
self
.
main
:
if
parent
.
op
==
self
.
main
:
# If we have main(x, y), numx, denumx, numy and denumy
# If we have main(x, y), numx, denumx, numy and denumy
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论