refactor: rename ArbitraryFunction to UnivariateFunction

- the naming has always been confusing and recent changes to the code make
this rename necessary for things to be clearer
This commit is contained in:
Arthur Meyre
2021-10-11 09:53:03 +02:00
parent 44016cc80c
commit 00916bcfdb
15 changed files with 72 additions and 69 deletions

View File

@@ -31,7 +31,7 @@ The float subgraph that was detected:
![](../../_static/float_fusing_example/subgraph.png)
The simplified graph of operations with the float subgraph condensed in an `ArbitraryFunction` node:
The simplified graph of operations with the float subgraph condensed in an `UnivariateFunction` node:
![](../../_static/float_fusing_example/after.png)
@@ -39,7 +39,7 @@ The simplified graph of operations with the float subgraph condensed in an `Arbi
The first step consists in detecting where we go from floating point computation back to integers. This allows to identify the potential terminal node of the float subgraph we are going to fuse.
From the terminal node, we go back up through the nodes until we find nodes that go from integers to floats. If we can guarantee the identified float subgraph has a single variable integer input then we can replace it by an equivalent ArbitraryFunction node.
From the terminal node, we go back up through the nodes until we find nodes that go from integers to floats. If we can guarantee the identified float subgraph has a single variable integer input then we can replace it by an equivalent UnivariateFunction node.
An example of a non fusable computation with that technique is:

View File

@@ -83,7 +83,7 @@ Traceback (most recent call last):
File "/src/concrete/numpy/compile.py", line 103, in _compile_numpy_function_into_op_graph_internal
raise ValueError(
ValueError: <lambda> cannot be compiled as it has nodes with either float inputs or outputs.
Offending nodes : <concrete.common.representation.intermediate.ArbitraryFunction object at 0x7f6689fd37f0>
Offending nodes : <concrete.common.representation.intermediate.UnivariateFunction object at 0x7f6689fd37f0>
```
## Manual export