MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / get_raw

Function get_raw

src/array.rs:1353–1361  ·  view source on GitHub ↗
(slf: &Bound<'_, PyArray<T, D>>, index: Idx)

Source from the content-addressed store, hash-verified

1351
1352#[inline(always)]
1353fn get_raw<T, D, Idx>(slf: &Bound<'_, PyArray<T, D>>, index: Idx) -> Option<*mut T>
1354where
1355 T: Element,
1356 D: Dimension,
1357 Idx: NpyIndex<Dim = D>,
1358{
1359 let offset = index.get_checked::<T>(slf.shape(), slf.strides())?;
1360 Some(unsafe { slf.data().offset(offset) })
1361}
1362
1363fn as_view<T, D, S, F>(slf: &Bound<'_, PyArray<T, D>>, from_shape_ptr: F) -> ArrayBase<S, D>
1364where

Callers 2

getMethod · 0.85
get_mutMethod · 0.85

Calls 3

stridesMethod · 0.80
dataMethod · 0.80
shapeMethod · 0.45

Tested by

no test coverage detected