Skip to content

Commit cf9c41a

Browse files
committed
Suppress a deprecation warning on import from dpctl.tensor submodule
1 parent cb146e8 commit cf9c41a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dpnp/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import os
3030
import sys
31+
import warnings
3132

3233
mypath = os.path.dirname(os.path.realpath(__file__))
3334

@@ -61,7 +62,9 @@
6162
)
6263

6364
# Borrowed from DPCTL
64-
from dpctl.tensor import __array_api_version__, DLDeviceType
65+
with warnings.catch_warnings():
66+
warnings.simplefilter("ignore", DeprecationWarning)
67+
from dpctl.tensor import __array_api_version__, DLDeviceType
6568

6669
from .dpnp_array import dpnp_array as ndarray
6770
from .dpnp_array_api_info import __array_namespace_info__

0 commit comments

Comments
 (0)