Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5236fff2
提交
5236fff2
authored
11月 27, 2012
作者:
Ian Goodfellow
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move more tests to deterministic interface
上级
c502818a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
test_var.py
theano/sandbox/cuda/tests/test_var.py
+7
-7
test_basic.py
theano/sparse/tests/test_basic.py
+1
-1
没有找到文件。
theano/sandbox/cuda/tests/test_var.py
浏览文件 @
5236fff2
...
@@ -60,11 +60,11 @@ class T_updates(unittest.TestCase):
...
@@ -60,11 +60,11 @@ class T_updates(unittest.TestCase):
data
=
numpy
.
float32
([
1
,
2
,
3
,
4
])
data
=
numpy
.
float32
([
1
,
2
,
3
,
4
])
x
=
f32sc
(
data
)
x
=
f32sc
(
data
)
y
=
x
**
2
y
=
x
**
2
f
=
theano
.
function
([],
y
,
updates
=
{
x
:
x
+
1
}
)
f
=
theano
.
function
([],
y
,
updates
=
[(
x
,
x
+
1
)]
)
f
()
f
()
# Test that we can update with a CudaVariable
# Test that we can update with a CudaVariable
f
=
theano
.
function
([],
y
,
updates
=
{
x
:
cuda
.
gpu_from_host
(
x
+
1
)}
)
f
=
theano
.
function
([],
y
,
updates
=
[(
x
,
cuda
.
gpu_from_host
(
x
+
1
))]
)
f
()
f
()
def
test_2
(
self
):
def
test_2
(
self
):
...
@@ -74,7 +74,7 @@ class T_updates(unittest.TestCase):
...
@@ -74,7 +74,7 @@ class T_updates(unittest.TestCase):
value
=
numpy
.
zeros
((
10
,
10
),
'float32'
))
value
=
numpy
.
zeros
((
10
,
10
),
'float32'
))
x
=
tensor
.
fmatrix
(
'x'
)
x
=
tensor
.
fmatrix
(
'x'
)
output_updates
=
{
output_var
:
x
**
2
}
output_updates
=
[(
output_var
,
x
**
2
)]
output_givens
=
{
x
:
data
}
output_givens
=
{
x
:
data
}
output_func
=
theano
.
function
(
inputs
=
[],
outputs
=
[],
output_func
=
theano
.
function
(
inputs
=
[],
outputs
=
[],
updates
=
output_updates
,
givens
=
output_givens
)
updates
=
output_updates
,
givens
=
output_givens
)
...
@@ -89,8 +89,8 @@ class T_updates(unittest.TestCase):
...
@@ -89,8 +89,8 @@ class T_updates(unittest.TestCase):
# the update_var has type matrix, and the update expression
# the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should not be allowed.
# is a broadcasted scalar, and that should not be allowed.
self
.
assertRaises
(
TypeError
,
theano
.
function
,
inputs
=
[],
outputs
=
[],
self
.
assertRaises
(
TypeError
,
theano
.
function
,
inputs
=
[],
outputs
=
[],
updates
=
{
output_var
:
updates
=
[(
output_var
,
output_var
.
sum
()
}
)
output_var
.
sum
()
)]
)
def
test_err_broadcast
(
self
):
def
test_err_broadcast
(
self
):
# Test that we raise a good error message when we don't
# Test that we raise a good error message when we don't
...
@@ -101,8 +101,8 @@ class T_updates(unittest.TestCase):
...
@@ -101,8 +101,8 @@ class T_updates(unittest.TestCase):
# the update_var has type matrix, and the update expression
# the update_var has type matrix, and the update expression
# is a broadcasted scalar, and that should not be allowed.
# is a broadcasted scalar, and that should not be allowed.
self
.
assertRaises
(
TypeError
,
theano
.
function
,
inputs
=
[],
outputs
=
[],
self
.
assertRaises
(
TypeError
,
theano
.
function
,
inputs
=
[],
outputs
=
[],
updates
=
{
output_var
:
updates
=
[(
output_var
,
output_var
.
sum
()
.
dimshuffle
(
'x'
,
'x'
)
}
)
output_var
.
sum
()
.
dimshuffle
(
'x'
,
'x'
)
)]
)
def
test_broadcast
(
self
):
def
test_broadcast
(
self
):
# Test that we can rebroadcast
# Test that we can rebroadcast
...
...
theano/sparse/tests/test_basic.py
浏览文件 @
5236fff2
...
@@ -1219,7 +1219,7 @@ class UsmmTests(unittest.TestCase):
...
@@ -1219,7 +1219,7 @@ class UsmmTests(unittest.TestCase):
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'fusion'
)
mode
=
theano
.
compile
.
mode
.
get_default_mode
()
.
excluding
(
'fusion'
)
if
inplace
:
if
inplace
:
updates
=
{
z
:
z
-
a
*
theano
.
sparse
.
dot
(
x
,
y
)}
updates
=
[(
z
,
z
-
a
*
theano
.
sparse
.
dot
(
x
,
y
))]
f_a
=
theano
.
function
([
a
,
x
,
y
],
[],
f_a
=
theano
.
function
([
a
,
x
,
y
],
[],
updates
=
updates
,
updates
=
updates
,
mode
=
mode
)
mode
=
mode
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论