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

Commit

Permalink
Add parameter html_size to onnxview
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Sep 14, 2021
1 parent 87d1f30 commit 69efdd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mlprodict/onnxrt/doc/nb_helper.py
Expand Up @@ -10,7 +10,7 @@


def onnxview(graph, recursive=False, local=False, add_rt_shapes=False,
runtime='python', size=None):
runtime='python', size=None, html_size=None):
"""
Displays an :epkg:`ONNX` graph into a notebook.
Expand All @@ -24,13 +24,16 @@ def onnxview(graph, recursive=False, local=False, add_rt_shapes=False,
:param runtime: the view fails if a runtime does not implement a specific
node unless *runtime* is `'empty'`
:param size: graph size
:param html_size: html size
.. versionchanged:: 0.6
Parameter *runtime* was added.
"""
sess = OnnxInference(graph, skip_run=not add_rt_shapes, runtime=runtime)
dot = sess.to_dot(recursive=recursive,
add_rt_shapes=add_rt_shapes, size=size)
if html_size is not None:
return RenderJsDot(dot, local=local, width=html_size, height=html_size)
return RenderJsDot(dot, local=local)


Expand Down Expand Up @@ -69,7 +72,8 @@ def onnxview(self, line):

if args is not None:
res = onnxview(args.graph, recursive=args.recursive,
local=args.local, add_rt_shapes=args.add_rt_shapes)
local=args.local, add_rt_shapes=args.add_rt_shapes,
size=args.size, html_size=args.html_size)
return res
return None

Expand Down

0 comments on commit 69efdd2

Please sign in to comment.