Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Add parameter show to plot_onnx (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Feb 11, 2021
1 parent 20bfc14 commit 991f12c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mlprodict/plotting/plotting_onnx.py
Expand Up @@ -6,7 +6,8 @@
from ..onnxrt import OnnxInference


def plot_onnx(onx, ax=None, dpi=300, temp_dot=None, temp_img=None):
def plot_onnx(onx, ax=None, dpi=300, temp_dot=None, temp_img=None,
show=False):
"""
Plots an ONNX graph into graph.
Expand All @@ -17,6 +18,7 @@ def plot_onnx(onx, ax=None, dpi=300, temp_dot=None, temp_img=None):
if None, a file is created and removed
:param temp_img: temporary image,
if None, a file is created and removed
:param show: calls `plt.show()`
:return: axes
"""
# delayed import
Expand All @@ -30,4 +32,6 @@ def plot_onnx(onx, ax=None, dpi=300, temp_dot=None, temp_img=None):
oinf = onx
dot = oinf.to_dot()
plot_graphviz(dot, dpi=dpi, ax=ax, temp_dot=temp_dot, temp_img=temp_img)
if show:
plt.show() # pragma: no cover
return ax

0 comments on commit 991f12c

Please sign in to comment.