mlx_rs::ops

Function stack_all_device

Source
pub fn stack_all_device(
    arrays: &[impl AsRef<Array>],
    stream: impl AsRef<Stream>,
) -> 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]);