Skip to content

Commit

Permalink
Fix doc for compilation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobj committed Mar 20, 2021
1 parent f62430f commit 13c8362
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions cgp/cartesian_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def to_func(self) -> Callable[..., List[float]]:
Returns
-------
Callable or Tuple[Callable]
Callable
"""
self._format_output_str_of_all_nodes()
Expand Down Expand Up @@ -317,7 +317,8 @@ def to_torch(self) -> "torch.nn.Module":
this graph.
The generated instance will have a `forward` method accepting
Torch tensor and returning a tensor.
Torch tensor of dimension (<batch size>, n_inputs) and
returning a tensor of dimension (<batch_size>, n_outputs).
Returns
-------
Expand Down Expand Up @@ -382,9 +383,12 @@ def _format_output_str_sympy_of_all_nodes(self):
def to_sympy(
self, simplify: Optional[bool] = True
) -> Union["sympy_expr.Expr", List["sympy_expr.Expr"]]:
"""Compile the function(s) represented by the graph to a SymPy expression.
"""Create SymPy expression(s) representing the function(s) described
by this graph.
Generates one SymPy expression for each output node.
Returns a list of SymPy expressions, one for each output
node. For convenience, if only one output node is defined, it
directly returns its expression.
Parameters
----------
Expand All @@ -394,8 +398,9 @@ def to_sympy(
Returns
----------
List[sympy.core.expr.Expr]
List of SymPy expressions.
List[sympy.core.expr.Expr] or sympy.core.expr.Expr
List of SymPy expressions or single expression.
"""

def possibly_unpack(
Expand Down

0 comments on commit 13c8362

Please sign in to comment.