MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / moddims

Function moddims

src/core/data.rs:678–693  ·  view source on GitHub ↗

Change the shape of the Array # Parameters - `input` is the input Array - `dims` is the new dimensions to which the input Array is reshaped to # Return Values Reshaped Array

(input: &Array<T>, dims: Dim4)

Source from the content-addressed store, hash-verified

676/// # Return Values
677/// Reshaped Array
678pub fn moddims<T>(input: &Array<T>, dims: Dim4) -> Array<T>
679where
680 T: HasAfEnum,
681{
682 unsafe {
683 let mut temp: af_array = std::ptr::null_mut();
684 let err_val = af_moddims(
685 &mut temp as *mut af_array,
686 input.get(),
687 dims.ndims() as c_uint,
688 dims.get().as_ptr() as *const dim_t,
689 );
690 HANDLE_ERROR(AfError::from(err_val));
691 temp.into()
692 }
693}
694
695/// Flatten the multidimensional Array to an 1D Array
696pub fn flat<T>(input: &Array<T>) -> Array<T>

Callers

nothing calls this directly

Calls 4

HANDLE_ERRORFunction · 0.85
ndimsMethod · 0.80
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected