Skip to content

Commit ffd492a

Browse files
committed
doc
1 parent 40841f7 commit ffd492a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

onnx_diagnostic/helpers/graph_helper.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List, Optional, Sequence, Set, Tuple, Union
1+
from typing import Dict, List, Optional, Sequence, Set, Tuple, Union
22
import onnx
33

44

@@ -72,7 +72,7 @@ def graph_positions(
7272
# initialization
7373
min_row = min(order)
7474
n_rows = max(order) + 1
75-
names = {}
75+
names: Dict[str, int] = {}
7676

7777
positions = [(min_row, i) for i in range(len(order))]
7878
for row in range(min_row, n_rows):
@@ -228,10 +228,13 @@ def text_rendering(self, prefix="") -> str:
228228
.. runpython::
229229
:showcode:
230230
231+
import textwrap
231232
import onnx
232233
import onnx.helper as oh
233234
from onnx_diagnostic.helpers.graph_helper import GraphRendering
234235
236+
TFLOAT = onnx.TensorProto.FLOAT
237+
235238
proto = oh.make_model(
236239
oh.make_graph(
237240
[
@@ -251,7 +254,7 @@ def text_rendering(self, prefix="") -> str:
251254
ir_version=9,
252255
)
253256
graph = GraphRendering(proto)
254-
text = textwrap.dedent(graph.text_rendering()).strip("\n")
257+
text = textwrap.dedent(graph.text_rendering()).strip("\\n")
255258
print(text)
256259
"""
257260
nodes = self.nodes

0 commit comments

Comments
 (0)