Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
dbc1b288
提交
dbc1b288
authored
9月 05, 2008
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
差异文件
merged in from trunk
上级
c3911d66
0c4855d3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
82 行增加
和
127 行删除
+82
-127
TODO-0.1.txt
TODO-0.1.txt
+75
-0
elemwise.py
elemwise.py
+6
-4
graph.py
gof/graph.py
+1
-123
没有找到文件。
TODO-0.1.txt
0 → 100644
浏览文件 @
dbc1b288
TODO
BUGS
* 0.1 bugs in trac
CODE
* Automatic Op documentation listing
* Implement RNG
* Implement state
* 0.2: Verbose mode for compile.function
* Go over sandbox and figure out what is still relevant
EPYDOC
* Add WRITEME to code
* Go over and remove all WRITEME
TRAC
* Add a "Rename page" plugin
* CoreTutorial:
* In 0.2, rewrite as developer documentation of how theano.function works
* For the time being, take the basic structure and make a
"how theano.function works page", to be written, then remove
CoreTutorial page.
* When implementation of state is done, CompileFunction should be re-read.
* Fix timestamp macro
* Make sure [[Timestamp]] give us the timestamp when the timestamp was added
* If behavior is different, then remove all instances of Timestamp
* FrequentlyAskedQuestions
* Move out of user docs, since it is not necessary
* In the getting started page, make sure to have a link to the mailing lists.
* GraphStructures
* Needs an introduction.
* Go over and make sure all documentation is current.
* Need a short version of the page: What is a Graph, for Users
* Longer version: Graph documentation, for Developers
* Make sure we have a good sequential list of articles for newbies.
* WhatWhyHow, merged with WhatIsTheano
* Simple tutorial / walkthrough / cookbook
* Use Tensor always, don't bother with Scalars
* InstallationNotes
* Make sure to point out that new Numpy (>=1.1) fixes memory leaks
(Ticket #146)
* TerminologyGlossary
=== Maybe the following is more detailed user documentation, but not necessarily for newbies
* What is a graph?
* What is an Op?
* How to Make Tensors
* IntroToTypes
* IntroToOps
* GraphOptimization
Rewrite. (Assigned to Pascal)
* HowToDebug
* HowToMakeOps
* Fix up InstallationNotes page
* Make a page TipsForSpeed
* How to enable optimizations
* How to have the correct BLAS library. [see installation page]
* [Don't actually write this page, just indicate what should be written.]
* OpWishList
* ProposalCCodeGen
* RandomNumbers
* TensorVsScalar
* Also describe about bug #96 how certain types (not float or int)
won't work with Scalar graphs that are compiled to C.
* Read over all "polished documentation" and make sure it looks good
* Home page
* Make sure that all wiki pages are included in the home page
* Give a better summary of each wiki page
* Section
User docs
Dev docs
Proposals + discussions
Historical proposals + discussion
* Package 0.1 documentation, so we are free to update it
elemwise.py
浏览文件 @
dbc1b288
...
...
@@ -603,11 +603,13 @@ class CAReduce(Op):
}
"""
%
locals
()
if
len
(
axis
)
==
1
:
all_code
=
[(
""
,
""
)]
*
nnested
+
[(
task0_decl
,
code1
),
""
]
if
node
.
inputs
[
0
]
.
type
.
ndim
:
if
len
(
axis
)
==
1
:
all_code
=
[(
""
,
""
)]
*
nnested
+
[(
task0_decl
,
code1
),
""
]
else
:
all_code
=
[(
""
,
""
)]
*
nnested
+
[(
task0_decl
,
""
)]
+
[(
""
,
""
)]
*
(
len
(
axis
)
-
2
)
+
[(
""
,
code1
),
""
]
else
:
all_code
=
[(
""
,
""
)]
*
nnested
+
[(
task0_decl
,
""
)]
+
[(
""
,
""
)]
*
(
len
(
axis
)
-
2
)
+
[(
""
,
code1
),
""
]
all_code
=
[
task0_decl
+
code1
]
loop
=
cgen
.
make_loop
([
order
,
range
(
nnested
)
+
[
'x'
]
*
len
(
axis
)],
[
idtype
,
odtype
],
all_code
,
sub
)
return
decl
,
checks
,
alloc
,
loop
...
...
gof/graph.py
浏览文件 @
dbc1b288
...
...
@@ -376,127 +376,6 @@ def clone_get_equiv(i, o, copy_inputs_and_orphans = True):
return
d
## Previous version
# for input in i:
# if copy_inputs_and_orphans:
# cpy = input.clone()
# cpy.owner = None
# cpy.index = None
# d[input] = cpy
# else:
# d[input] = input
#
# def clone_helper(result):
# if result in d:
# return d[result]
# node = result.owner
# if node is None: # result is an orphan
# if copy_inputs_and_orphans:
# cpy = result.clone()
# d[result] = cpy
# else:
# d[result] = result
# return d[result]
# else:
# new_node = node.clone_with_new_inputs([clone_helper(input) for input in node.inputs])
# d[node] = new_node
# for output, new_output in zip(node.outputs, new_node.outputs):
# d[output] = new_output
# return d[result]
#
# for output in o:
# clone_helper(output)
#
# return d
# def clone_with_new_inputs(i, o, new_i):
# equiv = clone_with_new_inputs_get_equiv(i, o, new_i)
# return [equiv[input] for input in i], [equiv[output] for output in o]
# def clone_with_new_inputs_get_equiv(i, o, new_i, copy_orphans = True):
# # note: this does not exactly mirror Apply.clone_with_new_inputs
# # here it is possible to give different types to new_i and then
# # make_node is called on the ops instead of clone_with_new_inputs
# # whenever the type is different.
# d = {}
# for input, new_input in zip(i, new_i):
# d[input] = new_input
# def clone_helper(result):
# if result in d:
# return d[result]
# node = result.owner
# if node is None: # result is an orphan
# if copy_orphans:
# cpy = result.clone()
# d[result] = cpy
# else:
# d[result] = result
# return d[result]
# else:
# cloned_inputs = [clone_helper(input) for input in node.inputs]
# if any(input != cloned_input for input, cloned_input in zip(node.inputs, cloned_inputs)):
# new_node = node.op.make_node(*cloned_inputs)
# else:
# new_node = node.clone_with_new_inputs(cloned_inputs)
# d[node] = new_node
# for output, new_output in zip(node.outputs, new_node.outputs):
# d[output] = new_output
# return d[result]
# for output in o:
# clone_helper(output)
# return d
def
clone_with_equiv
(
i
,
o
,
d
,
missing_input_policy
=
'fail'
,
orphan_policy
=
'copy'
):
def
clone_helper
(
result
):
if
result
in
d
:
return
d
[
result
]
node
=
result
.
owner
if
node
is
None
:
# result is an input or an orphan not in d
if
isinstance
(
result
,
Value
):
if
orphan_policy
==
'copy'
:
d
[
result
]
=
copy
(
result
)
elif
orphan_policy
==
'keep'
:
d
[
result
]
=
result
else
:
raise
ValueError
(
"unknown orphan_policy: '
%
s'"
%
orphan_policy
)
else
:
if
missing_input_policy
==
'fail'
:
raise
ValueError
(
"missing input:
%
s"
%
result
)
elif
missing_input_policy
==
'keep'
:
d
[
result
]
=
result
else
:
raise
ValueError
(
"unknown missing_input_policy: '
%
s'"
%
missing_input_policy
)
return
d
[
result
]
else
:
cloned_inputs
=
[
clone_helper
(
input
)
for
input
in
node
.
inputs
]
if
all
(
input
is
cloned_input
for
input
,
cloned_input
in
zip
(
node
.
inputs
,
cloned_inputs
)):
new_node
=
node
else
:
new_node
=
node
.
clone_with_new_inputs
(
cloned_inputs
,
strict
=
False
)
# if any(input != cloned_input for input, cloned_input in zip(node.inputs, cloned_inputs)):
# new_node = node.op.make_node(*cloned_inputs)
# else:
# new_node = node.clone_with_new_inputs(cloned_inputs)
d
[
node
]
=
new_node
for
output
,
new_output
in
zip
(
node
.
outputs
,
new_node
.
outputs
):
d
[
output
]
=
new_output
return
d
[
result
]
for
output
in
o
:
clone_helper
(
output
)
return
[
d
[
input
]
for
input
in
i
],
[
d
[
output
]
for
output
in
o
]
def
general_toposort
(
r_out
,
deps
,
debug_print
=
False
):
"""
@note: deps(i) should behave like a pure function (no funny business with
...
...
@@ -561,8 +440,6 @@ def io_toposort(i, o, orderings = {}):
return
[
o
for
o
in
topo
if
isinstance
(
o
,
Apply
)]
default_leaf_formatter
=
str
default_node_formatter
=
lambda
op
,
argstrings
:
"
%
s(
%
s)"
%
(
op
.
op
,
", "
.
join
(
argstrings
))
...
...
@@ -667,3 +544,4 @@ def view_roots(r):
else
:
return
[
r
]
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论