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

Commit202562c

Browse files
committed
array
"
1 parent6a70ac5 commit202562c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎onnx_array_api/array_api/_onnx_common.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
importnumpyasnp
44
fromonnximportTensorProto
55

6-
withwarnings.catch_warnings():
7-
warnings.simplefilter("ignore")
8-
fromnumpy.array_api._array_objectimportArray
6+
try:
7+
withwarnings.catch_warnings():
8+
warnings.simplefilter("ignore")
9+
fromnumpy.array_api._array_objectimportArray
10+
exceptImportError:
11+
Array=None
912
from ..npx.npx_typesimport (
1013
DType,
1114
ElemType,
@@ -107,7 +110,7 @@ def asarray(
107110
v=TEagerTensor(np.array(a))
108111
elifisinstance(a,np.ndarray):
109112
v=TEagerTensor(a)
110-
elifisinstance(a,Array):
113+
elifArrayandisinstance(a,Array):
111114
v=TEagerTensor(np.asarray(a))
112115
else:
113116
raiseRuntimeError(f"Unexpected type{type(a)} for the first input.")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp