Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
8a15ca52
提交
8a15ca52
authored
3月 04, 2009
作者:
Olivier Breuleux
浏览文件
操作
浏览文件
下载
差异文件
merge
上级
b8f816d1
faee95e7
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
34 行增加
和
4 行删除
+34
-4
docgen.py
scripts/docgen.py
+25
-1
debugmode.py
theano/compile/debugmode.py
+0
-0
function_module.py
theano/compile/function_module.py
+6
-2
elemwise.py
theano/tensor/elemwise.py
+3
-1
没有找到文件。
scripts/docgen.py
浏览文件 @
8a15ca52
import
sys
import
sys
import
os
import
os
import
shutil
import
inspect
import
inspect
from
epydoc
import
docintrospecter
from
epydoc
import
docintrospecter
...
@@ -98,13 +99,36 @@ if __name__ == '__main__':
...
@@ -98,13 +99,36 @@ if __name__ == '__main__':
if
options
[
'--all'
]
or
options
[
'--epydoc'
]:
if
options
[
'--all'
]
or
options
[
'--epydoc'
]:
from
epydoc.cli
import
cli
from
epydoc.cli
import
cli
sys
.
path
[
0
:
0
]
=
throot
sys
.
path
[
0
:
0
]
=
throot
#Generate HTML doc
#os.system("epydoc --config doc/api/epydoc.conf -o html/api")
sys
.
argv
[:]
=
[
''
,
'--config'
,
'
%
s/doc/api/epydoc.conf'
%
throot
,
'-o'
,
'api'
]
sys
.
argv
[:]
=
[
''
,
'--config'
,
'
%
s/doc/api/epydoc.conf'
%
throot
,
'-o'
,
'api'
]
cli
()
cli
()
# os.system("epydoc --config doc/api/epydoc.conf -o html/api")
# Generate PDF doc
# TODO
if
options
[
'--all'
]
or
options
[
'--rst'
]:
if
options
[
'--all'
]
or
options
[
'--rst'
]:
import
sphinx
import
sphinx
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
join
(
throot
,
'doc'
)]
sys
.
path
[
0
:
0
]
=
[
os
.
path
.
join
(
throot
,
'doc'
)]
sphinx
.
main
([
''
,
'-E'
,
os
.
path
.
join
(
throot
,
'doc'
),
'.'
])
sphinx
.
main
([
''
,
'-E'
,
os
.
path
.
join
(
throot
,
'doc'
),
'.'
])
# Generate latex file in a temp directory
import
tempfile
workdir
=
tempfile
.
mkdtemp
()
sphinx
.
main
([
''
,
'-E'
,
'-b'
,
'latex'
,
os
.
path
.
join
(
throot
,
'doc'
),
workdir
])
# Compile to PDF
currentdir
=
os
.
getcwd
()
os
.
chdir
(
workdir
)
os
.
system
(
'make'
)
try
:
shutil
.
copy
(
os
.
path
.
join
(
workdir
,
'theano.pdf'
),
currentdir
)
os
.
chdir
(
currentdir
)
shutil
.
rmtree
(
workdir
)
except
OSError
,
e
:
print
'OSError:'
,
e
theano/compile/debugmode.py
浏览文件 @
8a15ca52
差异被折叠。
点击展开。
theano/compile/function_module.py
浏览文件 @
8a15ca52
...
@@ -288,8 +288,12 @@ class Function(object):
...
@@ -288,8 +288,12 @@ class Function(object):
# if we are allowing garbage collection, remove the input and output reference from the internal
# if we are allowing garbage collection, remove the input and output reference from the internal
# storage cells
# storage cells
if
getattr
(
self
.
fn
,
'allow_gc'
,
False
):
if
getattr
(
self
.
fn
,
'allow_gc'
,
False
):
for
x
in
self
.
output_storage
:
assert
len
(
self
.
output_storage
)
==
len
(
self
.
maker
.
env
.
outputs
)
x
.
storage
[
0
]
=
None
#WARNING: This circumvents the 'readonly' attribute in x
for
o_container
,
o_result
in
zip
(
self
.
output_storage
,
self
.
maker
.
env
.
outputs
):
if
o_result
.
owner
is
not
None
:
# this node is the result of computation
# WARNING: This circumvents the 'readonly' attribute in x
o_container
.
storage
[
0
]
=
None
# Update the inputs that have an update function
# Update the inputs that have an update function
for
input
,
storage
in
reversed
(
zip
(
self
.
maker
.
expanded_inputs
,
self
.
input_storage
)):
for
input
,
storage
in
reversed
(
zip
(
self
.
maker
.
expanded_inputs
,
self
.
input_storage
)):
...
...
theano/tensor/elemwise.py
浏览文件 @
8a15ca52
...
@@ -160,6 +160,8 @@ class DimShuffle(Op):
...
@@ -160,6 +160,8 @@ class DimShuffle(Op):
def
perform
(
self
,
node
,
(
input
,
),
(
storage
,
)):
def
perform
(
self
,
node
,
(
input
,
),
(
storage
,
)):
# drop
# drop
res
=
input
res
=
input
if
type
(
res
)
!=
numpy
.
ndarray
:
raise
TypeError
(
res
)
shape
=
list
(
res
.
shape
)
shape
=
list
(
res
.
shape
)
for
drop
in
reversed
(
self
.
drop
):
for
drop
in
reversed
(
self
.
drop
):
shape
.
pop
(
drop
)
shape
.
pop
(
drop
)
...
@@ -178,7 +180,7 @@ class DimShuffle(Op):
...
@@ -178,7 +180,7 @@ class DimShuffle(Op):
if
not
self
.
inplace
:
if
not
self
.
inplace
:
res
=
numpy
.
copy
(
res
)
res
=
numpy
.
copy
(
res
)
storage
[
0
]
=
res
storage
[
0
]
=
numpy
.
asarray
(
res
)
#asarray puts scalars back into array
def
c_code
(
self
,
node
,
name
,
(
input
,),
(
res
,),
sub
):
def
c_code
(
self
,
node
,
name
,
(
input
,),
(
res
,),
sub
):
def
statements
(
lst
):
def
statements
(
lst
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论