Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d10856f6
提交
d10856f6
authored
8月 13, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
numpydoc for theano/compile/builders.py
上级
0a7415d7
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
6 行删除
+10
-6
builders.py
theano/compile/builders.py
+10
-6
没有找到文件。
theano/compile/builders.py
浏览文件 @
d10856f6
...
@@ -10,10 +10,11 @@ from functools import reduce
...
@@ -10,10 +10,11 @@ from functools import reduce
class
OpFromGraph
(
gof
.
Op
):
class
OpFromGraph
(
gof
.
Op
):
"""This creates an `Op` from inputs and outputs lists of variables.
"""
This creates an `Op` from inputs and outputs lists of variables.
The signature is similar to theano.function() and the resulting
The signature is similar to theano.function() and the resulting
`Op`'s perform will do the same operation as:
:
`Op`'s perform will do the same operation as:
orig_function(inputs, outputs, **kwargs)
orig_function(inputs, outputs, **kwargs)
...
@@ -31,12 +32,16 @@ class OpFromGraph(gof.Op):
...
@@ -31,12 +32,16 @@ class OpFromGraph(gof.Op):
- Add support to pickle this Op.
- Add support to pickle this Op.
- Add support/test with random generator
- Add support/test with random generator
:note:
Notes
-----
- We support shared variables in the inner graph. This is automatic and
- We support shared variables in the inner graph. This is automatic and
invisible to the user. They can be as input to the node or in the
invisible to the user. They can be as input to the node or in the
inner graph.
inner graph.
- We support unused inputs. This is needed for the grad.
- We support unused inputs. This is needed for the grad.
Examples
--------
Example 1:
Example 1:
.. code-block:: python
.. code-block:: python
...
@@ -49,8 +54,6 @@ class OpFromGraph(gof.Op):
...
@@ -49,8 +54,6 @@ class OpFromGraph(gof.Op):
e2 = op(x, y, z) + op(z, y, x)
e2 = op(x, y, z) + op(z, y, x)
fn = function([x, y, z], [e2])
fn = function([x, y, z], [e2])
Example 2 with shared variable:
Example 2 with shared variable:
.. code-block:: python
.. code-block:: python
...
@@ -139,7 +142,8 @@ class OpFromGraph(gof.Op):
...
@@ -139,7 +142,8 @@ class OpFromGraph(gof.Op):
def
connection_pattern
(
self
,
node
):
def
connection_pattern
(
self
,
node
):
"""
"""
Return connection pattern of subfgraph defined by inputs and outputs
Return connection pattern of subfgraph defined by inputs and outputs.
"""
"""
return
io_connection_pattern
(
self
.
new_inputs
,
self
.
new_outputs
)
return
io_connection_pattern
(
self
.
new_inputs
,
self
.
new_outputs
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论