Skip to content

Commit f07bb4b

Browse files
committed
remove numpy.array_api
1 parent 0c8703a commit f07bb4b

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

_unittests/ut_array_api/test_hypothesis_array_api.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import unittest
2-
import warnings
32
from os import getenv
43
from functools import reduce
54
import packaging.version as pv
@@ -45,12 +44,7 @@ class TestHypothesisArraysApis(ExtTestCase):
4544

4645
@classmethod
4746
def setUpClass(cls):
48-
try:
49-
import array_api_strict as xp
50-
except ImportError:
51-
with warnings.catch_warnings():
52-
warnings.simplefilter("ignore")
53-
from numpy import array_api as xp
47+
import array_api_strict as xp
5448

5549
api_version = getenv(
5650
"ARRAY_API_TESTS_VERSION",

onnx_array_api/array_api/_onnx_common.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
from typing import Any, Optional
2-
import warnings
32
import numpy as np
43
from onnx import TensorProto
5-
6-
try:
7-
import array_api_strict
8-
9-
Array = type(array_api_strict.ones((1,)))
10-
except ImportError:
11-
with warnings.catch_warnings():
12-
warnings.simplefilter("ignore")
13-
from numpy.array_api._array_object import Array
4+
import array_api_strict
145

156
from ..npx.npx_types import (
167
DType,
@@ -36,6 +27,9 @@
3627
)
3728

3829

30+
Array = type(array_api_strict.ones((1,)))
31+
32+
3933
# These functions with no specific code do not have to be
4034
# implemented. They are automatically added in
4135
# :mod:`onnx_array_api.array_api`. It needs

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy