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

Commitd00d823

Browse files
committed
better constant
1 parent7330b58 commitd00d823

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎onnx_array_api/graph_api/graph_builder.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ def _get_tensor_shape(
173173
returntuple(att.floats)
174174
ifatt.name=="value_ints":
175175
return (len(att.ints),)
176+
ifatt.name=="value":
177+
t=onh.to_array(att.t)
178+
returnt.shape
176179
raiseTypeError(
177180
f"Unexpected or unsupported scenario type{type(proto)}:{proto}."
178181
)
@@ -190,6 +193,9 @@ def _get_tensor_type(self, proto: Union[NodeProto, TensorProto]) -> int:
190193
returnTensorProto.FLOAT
191194
ifatt.name=="value_ints":
192195
returnTensorProto.INT64
196+
ifatt.name=="value":
197+
t=onh.to_array(att.t)
198+
returnoh.np_dtype_to_tensor_dtype(t.dtype)
193199
raiseValueError(f"Unexpected type or value{type(proto)}:{proto}.")
194200

195201
defis_constant(self,name:str)->bool:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp