提交 48789075 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Clean up FunctionGraph's docstring

上级 f1ce6f5d
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论