Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
48789075
提交
48789075
authored
2月 14, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
2月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up FunctionGraph's docstring
上级
f1ce6f5d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
16 行删除
+12
-16
fg.py
aesara/graph/fg.py
+12
-16
没有找到文件。
aesara/graph/fg.py
浏览文件 @
48789075
...
@@ -14,11 +14,11 @@ from aesara.misc.ordered_set import OrderedSet
...
@@ -14,11 +14,11 @@ from aesara.misc.ordered_set import OrderedSet
class
FunctionGraph
(
MetaObject
):
class
FunctionGraph
(
MetaObject
):
"""
r
"""
A `FunctionGraph` represents a subgraph bound by a set of input variables and
A `FunctionGraph` represents a subgraph bound by a set of input variables and
a set of output variables, ie a subgraph that specifies an Aesara function.
a set of output variables, ie a subgraph that specifies an Aesara function.
The inputs list should contain all the inputs on which the outputs depend.
The inputs list should contain all the inputs on which the outputs depend.
`
`Variable``s of type ``Constant`
` are not counted as inputs.
`
Variable`\s of type `Constant
` are not counted as inputs.
The `FunctionGraph` supports the replace operation which allows to replace
The `FunctionGraph` supports the replace operation which allows to replace
a variable in the subgraph by another, e.g. replace ``(x + x).out`` by
a variable in the subgraph by another, e.g. replace ``(x + x).out`` by
...
@@ -26,26 +26,22 @@ class FunctionGraph(MetaObject):
...
@@ -26,26 +26,22 @@ class FunctionGraph(MetaObject):
This class is also responsible for verifying that a graph is valid
This class is also responsible for verifying that a graph is valid
(ie, all the dtypes and broadcast patterns are compatible with the
(ie, all the dtypes and broadcast patterns are compatible with the
way the `
`Variable``s are used) and for tracking the ``Variable``
s with
way the `
Variable`\s are used) and for tracking the `Variable`\
s with
a
``clients`` field that specifies which ``Apply`` nodes use the ``Variable``.
a
:attr:`FunctionGraph.clients` ``dict`` that specifies which `Apply` nodes
The ``clients`` field combined with the ``Variable.owner`` field and the
use the `Variable`. The :attr:`FunctionGraph.clients` field, combined with
``Apply`` nodes' ``Apply.inputs`` field allows the graph to be traversed in
the :attr:`Variable.owner` and each :attr:`Apply.inputs`, allows the graph
both directions.
to be traversed in
both directions.
It can also be extended with new features using
It can also be extended with new features using
``FunctionGraph.attach_feature(<Feature instance>)``.
:meth:`FunctionGraph.attach_feature`. See `Feature` for event types and
See ``Feature`` for event types and documentation.
documentation. Extra features allow the `FunctionGraph` to verify new
Extra features allow the `FunctionGraph` to verify new properties of
properties of a graph as it is optimized.
a graph as it is optimized.
Historically, the `FunctionGraph` was called an ``Env``. Keep this in mind
while reading out-of-date documentation, e-mail support threads, etc.
The constructor creates a `FunctionGraph` which operates on the subgraph
The constructor creates a `FunctionGraph` which operates on the subgraph
bound by the inputs and outputs sets.
bound by the inputs and outputs sets.
This class keeps
a pointer to the inputs and outputs, and also modifies
This class keeps
lists for the inputs and outputs and modifies them
them
.
in-place
.
"""
"""
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论