Skip to content

Commit

Permalink
chore: update api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fd0r committed Nov 9, 2022
1 parent 8dd8ffe commit 51a8019
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/developer-guide/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@
- [`onnx_impl_utils.compute_onnx_pool_padding`](./concrete.ml.onnx.onnx_impl_utils.md#function-compute_onnx_pool_padding): Compute any additional padding needed to compute pooling layers.
- [`onnx_impl_utils.numpy_onnx_pad`](./concrete.ml.onnx.onnx_impl_utils.md#function-numpy_onnx_pad): Pad a tensor according to ONNX spec, using an optional custom pad value.
- [`onnx_impl_utils.onnx_avgpool_compute_norm_const`](./concrete.ml.onnx.onnx_impl_utils.md#function-onnx_avgpool_compute_norm_const): Compute the average pooling normalization constant.
- [`onnx_model_manipulations.clean_graph_after_node`](./concrete.ml.onnx.onnx_model_manipulations.md#function-clean_graph_after_node): Clean the graph of the onnx model by removing nodes after the given node name.
- [`onnx_model_manipulations.clean_graph_after_node_name`](./concrete.ml.onnx.onnx_model_manipulations.md#function-clean_graph_after_node_name): Clean the graph of the onnx model by removing nodes after the given node name.
- [`onnx_model_manipulations.clean_graph_after_node_op_type`](./concrete.ml.onnx.onnx_model_manipulations.md#function-clean_graph_after_node_op_type): Clean the graph of the onnx model by removing nodes after the given node type.
- [`onnx_model_manipulations.keep_following_outputs_discard_others`](./concrete.ml.onnx.onnx_model_manipulations.md#function-keep_following_outputs_discard_others): Keep the outputs given in outputs_to_keep and remove the others from the model.
- [`onnx_model_manipulations.remove_identity_nodes`](./concrete.ml.onnx.onnx_model_manipulations.md#function-remove_identity_nodes): Remove identity nodes from a model.
- [`onnx_model_manipulations.remove_node_types`](./concrete.ml.onnx.onnx_model_manipulations.md#function-remove_node_types): Remove unnecessary nodes from the ONNX graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ ______________________________________________________________________

<a href="https://github.com/zama-ai/concrete-ml/tree/release/0.5.x/src/concrete/ml/onnx/onnx_model_manipulations.py#L168"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `clean_graph_after_node`
## <kbd>function</kbd> `clean_graph_after_node_name`

```python
clean_graph_after_node(onnx_model: ModelProto, node_name: str)
clean_graph_after_node_name(
onnx_model: ModelProto,
node_name: str,
fail_if_not_found: bool = True
)
```

Clean the graph of the onnx model by removing nodes after the given node name.
Expand All @@ -111,3 +115,34 @@ Clean the graph of the onnx model by removing nodes after the given node name.

- <b>`onnx_model`</b> (onnx.ModelProto): The onnx model.
- <b>`node_name`</b> (str): The node's name whose following nodes will be removed.
- <b>`fail_if_not_found`</b> (bool): If true, abort if the node name is not found

**Raises:**

- <b>`ValueError`</b>: if the node name is not found and if fail_if_not_found is set

______________________________________________________________________

<a href="https://github.com/zama-ai/concrete-ml/tree/release/0.5.x/src/concrete/ml/onnx/onnx_model_manipulations.py#L214"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `clean_graph_after_node_op_type`

```python
clean_graph_after_node_op_type(
onnx_model: ModelProto,
node_op_type: str,
fail_if_not_found: bool = True
)
```

Clean the graph of the onnx model by removing nodes after the given node type.

**Args:**

- <b>`onnx_model`</b> (onnx.ModelProto): The onnx model.
- <b>`node_op_type`</b> (str): The node's op_type whose following nodes will be removed.
- <b>`fail_if_not_found`</b> (bool): If true, abort if the node op_type is not found

**Raises:**

- <b>`ValueError`</b>: if the node op_type is not found and if fail_if_not_found is set

0 comments on commit 51a8019

Please sign in to comment.