|
1 | 1 | # cython: language_level=3
|
2 | 2 | # -*- coding: utf-8 -*-
|
3 | 3 | # *****************************************************************************
|
4 |
| -# Copyright (c) 2016-2020, Intel Corporation |
| 4 | +# Copyright (c) 2016-2022, Intel Corporation |
5 | 5 | # All rights reserved.
|
6 | 6 | #
|
7 | 7 | # Redistribution and use in source and binary forms, with or without
|
@@ -33,23 +33,77 @@ using USB interface for an Intel GPU device.
|
33 | 33 |
|
34 | 34 | """
|
35 | 35 |
|
| 36 | +import warnings |
36 | 37 |
|
37 | 38 | from libcpp cimport bool as cpp_bool
|
38 | 39 |
|
39 | 40 | from dpnp.dpnp_iface_types import *
|
40 |
| -from dpnp.dpnp_iface import * |
| 41 | + |
| 42 | +# It's prohibeted to use 'import *' from 'dpnp.dpnp_iface_arraycreation' module here, |
| 43 | +# because module has 'array' function, but cython has already imported 'array' by default. |
| 44 | +# It would cause import collision. Thus instead import each function explicitly. |
| 45 | +from dpnp.dpnp_iface_arraycreation import ( |
| 46 | + arange, |
| 47 | + array, |
| 48 | + asanyarray, |
| 49 | + asarray, |
| 50 | + ascontiguousarray, |
| 51 | + copy, |
| 52 | + diag, |
| 53 | + diagflat, |
| 54 | + empty, |
| 55 | + empty_like, |
| 56 | + eye, |
| 57 | + frombuffer, |
| 58 | + fromfile, |
| 59 | + fromfunction, |
| 60 | + fromiter, |
| 61 | + fromstring, |
| 62 | + full, |
| 63 | + full_like, |
| 64 | + geomspace, |
| 65 | + identity, |
| 66 | + linspace, |
| 67 | + loadtxt, |
| 68 | + logspace, |
| 69 | + meshgrid, |
| 70 | + mgrid, |
| 71 | + ogrid, |
| 72 | + ones, |
| 73 | + ones_like, |
| 74 | + ptp, |
| 75 | + trace, |
| 76 | + tri, |
| 77 | + tril, |
| 78 | + triu, |
| 79 | + vander, |
| 80 | + zeros, |
| 81 | + zeros_like |
| 82 | +) |
| 83 | +from dpnp.dpnp_iface_bitwise import * |
| 84 | +from dpnp.dpnp_iface_counting import * |
| 85 | +from dpnp.dpnp_iface_indexing import * |
| 86 | +from dpnp.dpnp_iface_libmath import * |
| 87 | +from dpnp.dpnp_iface_linearalgebra import * |
| 88 | +from dpnp.dpnp_iface_logic import * |
| 89 | +from dpnp.dpnp_iface_manipulation import * |
| 90 | +from dpnp.dpnp_iface_mathematical import * |
| 91 | +from dpnp.dpnp_iface_searching import * |
| 92 | +from dpnp.dpnp_iface_sorting import * |
| 93 | +from dpnp.dpnp_iface_statistics import * |
| 94 | +from dpnp.dpnp_iface_trigonometric import * |
41 | 95 |
|
42 | 96 | # to avoid interference with Python internal functions
|
43 | 97 | from dpnp.dpnp_iface import sum as iface_sum
|
44 | 98 | from dpnp.dpnp_iface import prod as iface_prod
|
45 | 99 | from dpnp.dpnp_iface import get_dpnp_descriptor as iface_get_dpnp_descriptor
|
46 | 100 |
|
47 |
| -from dpnp.dpnp_algo cimport * |
48 | 101 | from dpnp.dpnp_iface_statistics import min, max # TODO do the same as for iface_sum
|
49 | 102 | from dpnp.dpnp_iface_logic import all, any # TODO do the same as for iface_sum
|
50 | 103 | import numpy
|
51 | 104 | cimport numpy
|
52 | 105 |
|
| 106 | +from dpnp.dpnp_algo cimport * |
53 | 107 | cimport dpnp.dpnp_utils as utils
|
54 | 108 |
|
55 | 109 |
|
@@ -124,6 +178,12 @@ cdef class dparray:
|
124 | 178 |
|
125 | 179 | """
|
126 | 180 |
|
| 181 | + with warnings.catch_warnings(): |
| 182 | + warnings.filterwarnings("default", category=DeprecationWarning) |
| 183 | + warnings.warn("dpnp.dparray class is deprecated, use dpnp.dpnp_array class instead", |
| 184 | + DeprecationWarning, |
| 185 | + stacklevel=2) |
| 186 | +
|
127 | 187 | def __init__(self, shape, dtype=float64, memptr=None, strides=None, order=b'C'):
|
128 | 188 | cdef Py_ssize_t shape_it = 0
|
129 | 189 | cdef Py_ssize_t strides_it = 0
|
|
0 commit comments