mlx_rs::ops

Function stack_all

Source
pub fn stack_all(arrays: &[impl AsRef<Array>]) -> Result<Array>
Expand description

Stacks the arrays along a new axis. Returns an error if the arrays have different shapes.

§Params

  • arrays: The input arrays.

§Example

use mlx_rs::{Array, ops::*};

let a = Array::from_iter(0..4, &[2, 2]);
let b = Array::from_iter(4..8, &[2, 2]);
let result = stack_all(&[&a, &b]);