Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8a45c933
提交
8a45c933
authored
11月 23, 2010
作者:
David Warde-Farley
浏览文件
操作
浏览文件
下载
差异文件
Merge.
上级
b8e83557
c9f162d4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
29 行增加
和
5 行删除
+29
-5
conf.py
doc/conf.py
+2
-2
release.txt
doc/release.txt
+1
-1
test_basic.py
theano/sparse/tests/test_basic.py
+20
-0
basic.py
theano/tensor/basic.py
+5
-1
opt.py
theano/tensor/opt.py
+1
-1
test_tutorial.py
theano/tests/test_tutorial.py
+0
-0
没有找到文件。
doc/conf.py
浏览文件 @
8a45c933
...
@@ -51,9 +51,9 @@ copyright = '2008--2009, LISA lab'
...
@@ -51,9 +51,9 @@ copyright = '2008--2009, LISA lab'
# other places throughout the built documents.
# other places throughout the built documents.
#
#
# The short X.Y version.
# The short X.Y version.
version
=
'0.
1
'
version
=
'0.
3
'
# The full version, including alpha/beta/rc tags.
# The full version, including alpha/beta/rc tags.
release
=
'0.
1
'
release
=
'0.
3
'
# There are two options for replacing |today|: either, you set today to some
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# non-false value, then it is used:
...
...
doc/release.txt
浏览文件 @
8a45c933
...
@@ -47,7 +47,7 @@ welcome on the mailing list.
...
@@ -47,7 +47,7 @@ welcome on the mailing list.
6) Each release will be uploaded to pypi.python.org, mloss.org and freshmeat.net
6) Each release will be uploaded to pypi.python.org, mloss.org and freshmeat.net
7) Release emails will be sent to theano-users
and theano-announce
.
7) Release emails will be sent to theano-users
, theano-announce, numpy-discussion@scipy.org and scipy-user@scipy.org
.
Optional:
Optional:
...
...
theano/sparse/tests/test_basic.py
浏览文件 @
8a45c933
...
@@ -441,6 +441,26 @@ class test_structureddot(unittest.TestCase):
...
@@ -441,6 +441,26 @@ class test_structureddot(unittest.TestCase):
self
.
failUnless
(
numpy
.
allclose
(
theano_result
,
scipy_result
))
self
.
failUnless
(
numpy
.
allclose
(
theano_result
,
scipy_result
))
self
.
failIf
(
theano_time
>
overhead_rtol
*
scipy_time
+
overhead_tol
)
self
.
failIf
(
theano_time
>
overhead_rtol
*
scipy_time
+
overhead_tol
)
def
test_shape_i
():
sparse_dtype
=
'float32'
a
=
SparseType
(
'csr'
,
dtype
=
sparse_dtype
)()
f
=
theano
.
function
([
a
],
a
.
shape
[
1
],
mode
=
'FAST_RUN'
)
assert
f
(
sp
.
csr_matrix
(
random_lil
((
100
,
10
),
sparse_dtype
,
3
)))
==
(
10
)
def
test_shape
():
sparse_dtype
=
'float32'
a
=
SparseType
(
'csr'
,
dtype
=
sparse_dtype
)()
f
=
theano
.
function
([
a
],
a
.
shape
,
mode
=
'FAST_RUN'
)
assert
numpy
.
all
(
f
(
sp
.
csr_matrix
(
random_lil
((
100
,
10
),
sparse_dtype
,
3
)))
==
(
100
,
10
))
if
theano
.
config
.
mode
!=
'FAST_COMPILE'
:
topo
=
f
.
maker
.
env
.
toposort
()
assert
len
(
topo
)
==
3
assert
isinstance
(
topo
[
0
]
.
op
,
tensor
.
opt
.
Shape_i
)
assert
isinstance
(
topo
[
1
]
.
op
,
tensor
.
opt
.
Shape_i
)
assert
isinstance
(
topo
[
2
]
.
op
,
tensor
.
opt
.
MakeVector
)
import
theano.tensor.tests.test_sharedvar
import
theano.tensor.tests.test_sharedvar
test_shared_options
=
theano
.
tensor
.
tests
.
test_sharedvar
.
makeSharedTester
(
test_shared_options
=
theano
.
tensor
.
tests
.
test_sharedvar
.
makeSharedTester
(
theano
.
sparse
.
shared
,
'float64'
,
theano
.
sparse
.
shared
,
'float64'
,
...
...
theano/tensor/basic.py
浏览文件 @
8a45c933
...
@@ -1444,7 +1444,11 @@ class Shape(Op):
...
@@ -1444,7 +1444,11 @@ class Shape(Op):
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
__class__
.
__name__
return
self
.
__class__
.
__name__
def
make_node
(
self
,
x
):
def
make_node
(
self
,
x
):
x
=
as_tensor_variable
(
x
)
if
not
isinstance
(
x
,
Variable
):
raise
TypeError
(
'x must be Variable whose value have a shape attribute'
,
x
)
#Must work for all type that have a shape attribute.
#This will fail at execution time.
#x = as_tensor_variable(x)
return
Apply
(
self
,
[
x
],
[
lvector
()])
return
Apply
(
self
,
[
x
],
[
lvector
()])
def
perform
(
self
,
node
,
(
x
,
),
(
out
,
)):
def
perform
(
self
,
node
,
(
x
,
),
(
out
,
)):
out
[
0
]
=
theano
.
_asarray
(
x
.
shape
,
dtype
=
'int64'
)
out
[
0
]
=
theano
.
_asarray
(
x
.
shape
,
dtype
=
'int64'
)
...
...
theano/tensor/opt.py
浏览文件 @
8a45c933
...
@@ -465,7 +465,7 @@ class ShapeFeature(object):
...
@@ -465,7 +465,7 @@ class ShapeFeature(object):
"""
"""
def
shape_i
(
self
,
i
):
def
shape_i
(
self
,
i
):
def
op_deco
(
r
):
def
op_deco
(
r
):
if
r
.
type
.
broadcastable
[
i
]:
if
hasattr
(
r
.
type
,
"broadcastable"
)
and
r
.
type
.
broadcastable
[
i
]:
return
self
.
lscalar_one
return
self
.
lscalar_one
else
:
else
:
return
Shape_i
(
i
)(
r
)
return
Shape_i
(
i
)(
r
)
...
...
theano/tests/test_tutorial.py
浏览文件 @
8a45c933
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论