@@ -4,7 +4,9 @@ use std::ptr::null_mut;
4
4
5
5
use ndarray:: { Dimension , IxDyn } ;
6
6
use pyo3:: types:: PyAnyMethods ;
7
- use pyo3:: { Borrowed , Bound , FromPyObject , PyNativeType , PyResult } ;
7
+ #[ cfg( feature = "gil-refs" ) ]
8
+ use pyo3:: PyNativeType ;
9
+ use pyo3:: { Borrowed , Bound , FromPyObject , PyResult } ;
8
10
9
11
use crate :: array:: PyArray ;
10
12
use crate :: dtype:: Element ;
@@ -13,6 +15,7 @@ use crate::npyffi::{array::PY_ARRAY_API, NPY_CASTING, NPY_ORDER};
13
15
/// Return value of a function that can yield either an array or a scalar.
14
16
pub trait ArrayOrScalar < ' py , T > : FromPyObject < ' py > { }
15
17
18
+ #[ cfg( feature = "gil-refs" ) ]
16
19
impl < ' py , T , D > ArrayOrScalar < ' py , T > for & ' py PyArray < T , D >
17
20
where
18
21
T : Element ,
30
33
impl < ' py , T > ArrayOrScalar < ' py , T > for T where T : Element + FromPyObject < ' py > { }
31
34
32
35
/// Deprecated form of [`inner_bound`]
33
- #[ deprecated(
34
- since = "0.21.0" ,
35
- note = "will be replaced by `inner_bound` in the future"
36
- ) ]
36
+ #[ cfg( feature = "gil-refs" ) ]
37
37
pub fn inner < ' py , T , DIN1 , DIN2 , OUT > (
38
38
array1 : & ' py PyArray < T , DIN1 > ,
39
39
array2 : & ' py PyArray < T , DIN2 > ,
@@ -100,10 +100,7 @@ where
100
100
}
101
101
102
102
/// Deprecated form of [`dot_bound`]
103
- #[ deprecated(
104
- since = "0.21.0" ,
105
- note = "will be replaced by `dot_bound` in the future"
106
- ) ]
103
+ #[ cfg( feature = "gil-refs" ) ]
107
104
pub fn dot < ' py , T , DIN1 , DIN2 , OUT > (
108
105
array1 : & ' py PyArray < T , DIN1 > ,
109
106
array2 : & ' py PyArray < T , DIN2 > ,
@@ -176,10 +173,7 @@ where
176
173
}
177
174
178
175
/// Deprecated form of [`einsum_bound`]
179
- #[ deprecated(
180
- since = "0.21.0" ,
181
- note = "will be replaced by `einsum_bound` in the future"
182
- ) ]
176
+ #[ cfg( feature = "gil-refs" ) ]
183
177
pub fn einsum < ' py , T , OUT > ( subscripts : & str , arrays : & [ & ' py PyArray < T , IxDyn > ] ) -> PyResult < OUT >
184
178
where
185
179
T : Element ,
@@ -226,10 +220,7 @@ where
226
220
}
227
221
228
222
/// Deprecated form of [`einsum_bound!`][crate::einsum_bound!]
229
- #[ deprecated(
230
- since = "0.21.0" ,
231
- note = "will be replaced by `einsum_bound!` in the future"
232
- ) ]
223
+ #[ cfg( feature = "gil-refs" ) ]
233
224
#[ macro_export]
234
225
macro_rules! einsum {
235
226
( $subscripts: literal $( , $array: ident) + $( , ) * ) => { {
0 commit comments