(&self, is_fortran: bool)
| 1621 | } |
| 1622 | |
| 1623 | fn cast_array<U: Element>(&self, is_fortran: bool) -> PyResult<Bound<'py, PyArray<U, D>>> |
| 1624 | where |
| 1625 | T: Element, |
| 1626 | { |
| 1627 | let ptr = unsafe { |
| 1628 | PY_ARRAY_API.PyArray_CastToType( |
| 1629 | self.py(), |
| 1630 | self.as_array_ptr(), |
| 1631 | U::get_dtype(self.py()).into_dtype_ptr(), |
| 1632 | if is_fortran { -1 } else { 0 }, |
| 1633 | ) |
| 1634 | }; |
| 1635 | unsafe { Bound::from_owned_ptr_or_err(self.py(), ptr).map(|ob| ob.cast_into_unchecked()) } |
| 1636 | } |
| 1637 | |
| 1638 | fn permute<ID: IntoDimension>(&self, axes: Option<ID>) -> PyResult<Bound<'py, PyArray<T, D>>> { |
| 1639 | let mut axes = axes.map(|axes| axes.into_dimension()); |
no test coverage detected