Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a6057612
提交
a6057612
authored
3月 21, 2008
作者:
bergstrj@iro.umontreal.ca
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dot, gemm, fixing tests
上级
eba4c188
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
14 行增加
和
19 行删除
+14
-19
_test_tensor.py
_test_tensor.py
+3
-0
autotest.py
autotest.py
+2
-3
blas.py
blas.py
+0
-1
opt.py
opt.py
+7
-11
sparse.py
sparse.py
+2
-4
没有找到文件。
_test_tensor.py
浏览文件 @
a6057612
...
@@ -194,6 +194,7 @@ class T_subtensor(unittest.TestCase):
...
@@ -194,6 +194,7 @@ class T_subtensor(unittest.TestCase):
t
=
n
[
0
]
t
=
n
[
0
]
except
ValueError
,
e
:
except
ValueError
,
e
:
self
.
failUnless
(
e
[
0
]
is
Subtensor
.
e_invalid
)
self
.
failUnless
(
e
[
0
]
is
Subtensor
.
e_invalid
)
return
self
.
fail
()
self
.
fail
()
def
test1_err_bounds
(
self
):
def
test1_err_bounds
(
self
):
n
=
tinit
(
numpy
.
ones
(
3
))
n
=
tinit
(
numpy
.
ones
(
3
))
...
@@ -372,6 +373,7 @@ class T_abs(unittest.TestCase):
...
@@ -372,6 +373,7 @@ class T_abs(unittest.TestCase):
verify_grad
(
self
,
T_abs
.
AbsBadGrad
,
[
numpy
.
ones
(())])
verify_grad
(
self
,
T_abs
.
AbsBadGrad
,
[
numpy
.
ones
(())])
except
Exception
,
e
:
except
Exception
,
e
:
self
.
failUnless
(
str
(
e
)
==
verify_grad
.
E_grad
,
str
(
e
))
self
.
failUnless
(
str
(
e
)
==
verify_grad
.
E_grad
,
str
(
e
))
return
self
.
fail
()
self
.
fail
()
class
T_fill
(
unittest
.
TestCase
):
class
T_fill
(
unittest
.
TestCase
):
...
@@ -441,6 +443,7 @@ class T_mul(unittest.TestCase):
...
@@ -441,6 +443,7 @@ class T_mul(unittest.TestCase):
[
numpy
.
ones
(
3
),
numpy
.
ones
(
4
)],
1.0
)
[
numpy
.
ones
(
3
),
numpy
.
ones
(
4
)],
1.0
)
except
ValueError
,
e
:
except
ValueError
,
e
:
self
.
failUnless
(
e
[
0
]
is
tensor
.
_assert_same_shapes
.
E_shape
)
self
.
failUnless
(
e
[
0
]
is
tensor
.
_assert_same_shapes
.
E_shape
)
return
self
.
fail
()
self
.
fail
()
class
T_div
(
unittest
.
TestCase
):
class
T_div
(
unittest
.
TestCase
):
...
...
autotest.py
浏览文件 @
a6057612
...
@@ -4,10 +4,9 @@ def test_root_dir():
...
@@ -4,10 +4,9 @@ def test_root_dir():
suite
=
None
suite
=
None
filenames
=
os
.
listdir
(
'.'
)
filenames
=
os
.
listdir
(
'.'
)
for
filename
in
filenames
:
for
filename
in
filenames
:
if
filename
[
-
3
:]
==
'.py'
:
if
filename
[
-
3
:]
==
'.py'
and
filename
[
0
:
5
]
==
'_test'
:
modname
=
filename
[:
-
3
]
if
modname
in
[
'__init__'
,
'autotest'
]:
continue
#print >>sys.stderr, 'Loading', modname
#print >>sys.stderr, 'Loading', modname
modname
=
filename
[
0
:
-
3
]
tests
=
unittest
.
TestLoader
()
.
loadTestsFromModule
(
__import__
(
modname
))
tests
=
unittest
.
TestLoader
()
.
loadTestsFromModule
(
__import__
(
modname
))
if
tests
.
countTestCases
()
>
0
:
if
tests
.
countTestCases
()
>
0
:
print
>>
sys
.
stderr
,
'Testing'
,
modname
print
>>
sys
.
stderr
,
'Testing'
,
modname
...
...
blas.py
浏览文件 @
a6057612
import
os
,
sys
import
os
,
sys
from
gof
import
PatternOptimizer
as
pattern_opt
,
OpSubOptimizer
as
op_sub
import
scipy.weave
as
weave
import
scipy.weave
as
weave
"""
"""
...
...
opt.py
浏览文件 @
a6057612
from
core
import
*
import
gof
from
gof
import
PatternOptimizer
as
pattern_opt
,
OpSubOptimizer
as
op_sub
"""
"""
This variable is used in compile.prog as the optimizer for all programs built
This variable is used in compile.prog as the optimizer for all programs built
using either compile.single, compile.to_func, and compile.prog.
using either compile.single, compile.to_func, and compile.prog.
"""
def
optimizer
(
lst
):
if 0:
begin
=
gof
.
SeqOptimizer
([])
def optimizer(lst):
end
=
gof
.
SeqOptimizer
([
gof
.
DummyRemover
])
begin = gof.SeqOptimizer([])
seq_opt
=
gof
.
SeqOptimizer
(
begin
+
lst
+
end
)
end = gof.SeqOptimizer([gof.DummyRemover])
return
gof
.
PythonOpt
(
gof
.
MergeOptMerge
(
seq_opt
))
seq_opt = gof.SeqOptimizer(begin + lst + end)
return gof.PythonOpt(gof.MergeOptMerge(seq_opt))
if 0:
if 0:
optimizer_begin = gof.SeqOptimizer([opt for name, opt in [
optimizer_begin = gof.SeqOptimizer([opt for name, opt in [
...
@@ -34,3 +29,4 @@ if 0:
...
@@ -34,3 +29,4 @@ if 0:
(iadd_elemwise, 'y', 'x'))]]])
(iadd_elemwise, 'y', 'x'))]]])
# ['remove_copies', gof.OpRemover(array_copy)],
# ['remove_copies', gof.OpRemover(array_copy)],
# [None, gof.DummyRemover] # has to be at the end
# [None, gof.DummyRemover] # has to be at the end
"""
sparse.py
浏览文件 @
a6057612
...
@@ -3,13 +3,11 @@ import unittest
...
@@ -3,13 +3,11 @@ import unittest
import
numpy
import
numpy
from
scipy
import
sparse
from
scipy
import
sparse
import
gof.lib
import
gof
import
core
import
grad
# Wrapper type
# Wrapper type
class
SparseR
(
core
.
ResultBase
):
class
SparseR
(
gof
.
ResultBase
):
"""
"""
Attribute:
Attribute:
format - a subclass of sparse.spmatrix indicating self.data.__class__
format - a subclass of sparse.spmatrix indicating self.data.__class__
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论