Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
61c1d5cd
提交
61c1d5cd
authored
12月 14, 2010
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
better formatting following review.
上级
49091e90
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
13 行删除
+16
-13
test_pfunc.py
theano/compile/tests/test_pfunc.py
+6
-9
test_basic_ops.py
theano/sandbox/cuda/tests/test_basic_ops.py
+10
-4
没有找到文件。
theano/compile/tests/test_pfunc.py
浏览文件 @
61c1d5cd
...
...
@@ -654,7 +654,6 @@ class Test_aliasing_rules(unittest.TestCase):
# rule #2 reading back from theano-managed memory
assert
not
numpy
.
may_share_memory
(
A
.
get_value
(
borrow
=
False
),
data_of
(
A
))
def
test_sparse_input_aliasing_affecting_inplace_operations
(
self
):
##
## Note this test will never fail because I am not aware of any
...
...
@@ -662,7 +661,8 @@ class Test_aliasing_rules(unittest.TestCase):
try
:
import
scipy.sparse
as
sp
except
ImportError
:
pass
#the variable enable_sparse will be used to disable the test file.
# The variable enable_sparse will be used to disable the test file.
pass
from
theano.sparse
import
enable_sparse
if
enable_sparse
==
False
:
...
...
@@ -671,9 +671,9 @@ class Test_aliasing_rules(unittest.TestCase):
from
theano
import
sparse
## Note: to trigger this bug with theano rev 4586:2bc6fc7f218b,
# you need to make in inputs mutable (
so that inplace
# you need to make in inputs mutable (so that inplace
# operations are used) and to break the elemwise composition
# with some non-elemwise op (
here dot
)
# with some non-elemwise op (
here dot
)
x
=
sparse
.
SparseType
(
'csc'
,
dtype
=
'float64'
)()
y
=
sparse
.
SparseType
(
'csc'
,
dtype
=
'float64'
)()
...
...
@@ -702,15 +702,12 @@ class Test_aliasing_rules(unittest.TestCase):
assert
numpy
.
allclose
(
vals
.
todense
(),
bogus_vals
.
todense
())
def
test_input_aliasing_affecting_inplace_operations
(
self
):
## Note: to trigger this bug with theano rev 4586:2bc6fc7f218b,
# you need to make in inputs mutable (
so that inplace
# you need to make in inputs mutable (so that inplace
# operations are used) and to break the elemwise composition
# with some non-elemwise op (
here dot
)
# with some non-elemwise op (
here dot
)
x
=
theano
.
tensor
.
dvector
()
y
=
theano
.
tensor
.
dvector
()
m1
=
theano
.
tensor
.
dmatrix
()
...
...
theano/sandbox/cuda/tests/test_basic_ops.py
浏览文件 @
61c1d5cd
...
...
@@ -822,10 +822,16 @@ def test_shared_float32():
import
theano.tensor.tests.test_sharedvar
test_shared_options
=
theano
.
tensor
.
tests
.
test_sharedvar
.
makeSharedTester
(
tcn
.
shared_constructor
,
'float32'
,
False
,
False
,
False
,
cuda_ndarray
.
CudaNdarray
,
lambda
a
:
isinstance
(
a
,
cuda_ndarray
.
CudaNdarray
),
theano
.
tensor
.
exp
,
numpy
.
exp
,
shared_constructor_
=
tcn
.
shared_constructor
,
dtype_
=
'float32'
,
get_value_borrow_true_alias_
=
False
,
shared_borrow_true_alias_
=
False
,
set_value_borrow_true_alias_
=
False
,
internal_type_
=
cuda_ndarray
.
CudaNdarray
,
test_internal_type_
=
lambda
a
:
isinstance
(
a
,
cuda_ndarray
.
CudaNdarray
),
theano_fct_
=
theano
.
tensor
.
exp
,
ref_fct_
=
numpy
.
exp
,
cast_value_
=
numpy
.
asarray
,
add_matrix_
=
True
)
if
__name__
==
'__main__'
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论