Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf4f45e

Browse files
committed
improve display
1 parented4a4b6 commitdf4f45e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎onnx_array_api/array_api/_onnx_common.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def asarray(
9393
v=TEagerTensor(va)
9494
elifisinstance(a,float):
9595
v=TEagerTensor(np.array(a,dtype=np.float64))
96+
elifisinstance(a,complex):
97+
v=TEagerTensor(np.array(a,dtype=np.complex128))
9698
elifisinstance(a,bool):
9799
v=TEagerTensor(np.array(a,dtype=np.bool_))
98100
elifisinstance(a,str):

‎onnx_array_api/plotting/text_plot.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,10 +865,11 @@ def str_node(indent, node):
865865
content=""
866866
line_name_new[init.name]=len(rows)
867867
ifinit.doc_string:
868-
rows.append(
868+
t=(
869869
f"init: name={init.name!r} type={_get_type(init)} "
870-
f"shape={_get_shape(init)}{content} --{init.doc_string}"
870+
f"shape={_get_shape(init)}{content}"
871871
)
872+
rows.append(f"{t}{' '*max(0,70-len(t))}--{init.doc_string}")
872873
continue
873874
rows.append(
874875
f"init: name={init.name!r} type={_get_type(init)} "
@@ -1117,10 +1118,11 @@ def onnx_text_plot_io(model, verbose=False, att_display=None):
11171118
forinitinmodel.initializer:
11181119

11191120
ifinit.doc_string:
1120-
rows.append(
1121+
t=(
11211122
f"init: name={init.name!r} type={_get_type(init)} "
1122-
f"shape={_get_shape(init)} --{init.doc_string}"
1123+
f"shape={_get_shape(init)}"
11231124
)
1125+
rows.append(f"{t}{' '*max(0,70-len(t))}--{init.doc_string}")
11241126
continue
11251127
rows.append(
11261128
f"init: name={init.name!r} type={_get_type(init)} "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp