Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
18930408
提交
18930408
authored
3月 01, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove not used var.
上级
ec81225c
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
11 行删除
+10
-11
test_elemwise.py
theano/tensor/tests/test_elemwise.py
+10
-11
没有找到文件。
theano/tensor/tests/test_elemwise.py
浏览文件 @
18930408
...
@@ -467,7 +467,6 @@ class test_Prod(unittest.TestCase):
...
@@ -467,7 +467,6 @@ class test_Prod(unittest.TestCase):
# (and special cases: 1 zero in the row, more than 1 zero in the row)
# (and special cases: 1 zero in the row, more than 1 zero in the row)
x_val
=
numpy
.
asarray
([[
1
,
2
,
3
],
[
4
,
5
,
6
],
[
7
,
8
,
9
]],
x_val
=
numpy
.
asarray
([[
1
,
2
,
3
],
[
4
,
5
,
6
],
[
7
,
8
,
9
]],
dtype
=
'float32'
)
dtype
=
'float32'
)
x
=
theano
.
tensor
.
dmatrix
()
# now with verify_grad
# now with verify_grad
unittest_tools
.
verify_grad
(
Prod
(
axis
=
1
),
[
x_val
],
mode
=
self
.
mode
)
unittest_tools
.
verify_grad
(
Prod
(
axis
=
1
),
[
x_val
],
mode
=
self
.
mode
)
...
@@ -672,8 +671,8 @@ class T_sum_dtype(unittest.TestCase):
...
@@ -672,8 +671,8 @@ class T_sum_dtype(unittest.TestCase):
if
"complex"
in
input_dtype
:
if
"complex"
in
input_dtype
:
continue
continue
# Check that we can take the gradient
# Check that we can take the gradient
grad_var
=
tensor
.
grad
(
sum_var
.
sum
(),
x
,
tensor
.
grad
(
sum_var
.
sum
(),
x
,
disconnected_inputs
=
'ignore'
)
disconnected_inputs
=
'ignore'
)
idx
+=
1
idx
+=
1
def
test_sum_custom_acc_dtype
(
self
):
def
test_sum_custom_acc_dtype
(
self
):
...
@@ -707,8 +706,8 @@ class T_sum_dtype(unittest.TestCase):
...
@@ -707,8 +706,8 @@ class T_sum_dtype(unittest.TestCase):
if
"complex"
in
input_dtype
:
if
"complex"
in
input_dtype
:
continue
continue
# Check that we can take the gradient
# Check that we can take the gradient
grad_var
=
tensor
.
grad
(
sum_var
.
sum
(),
x
,
tensor
.
grad
(
sum_var
.
sum
(),
x
,
disconnected_inputs
=
'ignore'
)
disconnected_inputs
=
'ignore'
)
else
:
else
:
self
.
assertRaises
(
TypeError
,
self
.
assertRaises
(
TypeError
,
x
.
sum
,
acc_dtype
=
acc_dtype
,
axis
=
axis
)
x
.
sum
,
acc_dtype
=
acc_dtype
,
axis
=
axis
)
...
@@ -766,8 +765,8 @@ class T_mean_dtype(unittest.TestCase):
...
@@ -766,8 +765,8 @@ class T_mean_dtype(unittest.TestCase):
if
"complex"
in
mean_var
.
dtype
:
if
"complex"
in
mean_var
.
dtype
:
continue
continue
try
:
try
:
grad_var
=
tensor
.
grad
(
mean_var
.
sum
(),
x
,
tensor
.
grad
(
mean_var
.
sum
(),
x
,
disconnected_inputs
=
'ignore'
)
disconnected_inputs
=
'ignore'
)
except
NotImplementedError
:
except
NotImplementedError
:
# TrueDiv does not seem to have a gradient when
# TrueDiv does not seem to have a gradient when
# the numerator is complex.
# the numerator is complex.
...
@@ -843,8 +842,8 @@ class T_prod_dtype(unittest.TestCase):
...
@@ -843,8 +842,8 @@ class T_prod_dtype(unittest.TestCase):
if
"complex"
in
output_dtype
or
"complex"
in
input_dtype
:
if
"complex"
in
output_dtype
or
"complex"
in
input_dtype
:
continue
continue
# Check that we can take the gradient
# Check that we can take the gradient
grad_var
=
tensor
.
grad
(
prod_var
.
sum
(),
x
,
tensor
.
grad
(
prod_var
.
sum
(),
x
,
disconnected_inputs
=
'ignore'
)
disconnected_inputs
=
'ignore'
)
idx
+=
1
idx
+=
1
def
test_prod_custom_acc_dtype
(
self
):
def
test_prod_custom_acc_dtype
(
self
):
...
@@ -871,8 +870,8 @@ class T_prod_dtype(unittest.TestCase):
...
@@ -871,8 +870,8 @@ class T_prod_dtype(unittest.TestCase):
if
"complex"
in
acc_dtype
:
if
"complex"
in
acc_dtype
:
continue
continue
# Check that we can take the gradient
# Check that we can take the gradient
grad_var
=
tensor
.
grad
(
prod_var
.
sum
(),
x
,
tensor
.
grad
(
prod_var
.
sum
(),
x
,
disconnected_inputs
=
'ignore'
)
disconnected_inputs
=
'ignore'
)
else
:
else
:
self
.
assertRaises
(
TypeError
,
self
.
assertRaises
(
TypeError
,
x
.
prod
,
acc_dtype
=
acc_dtype
,
axis
=
axis
)
x
.
prod
,
acc_dtype
=
acc_dtype
,
axis
=
axis
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论