Skip to main content

concatenate

Function concatenate 

Source
pub fn concatenate(arrays: &[Array], axis: isize) -> Result<Array>
Expand description

arrays joined along axis (MLX’s concatenate): equal shapes except along axis, with dtypes promoted to a common one.

use nuvec_core::{Array, Result, concatenate};

let a = Array::from_slice(&[1.0f32, 2.0], &[1, 2])?;
let b = Array::from_slice(&[3i32, 4, 5, 6], &[2, 2])?;
let c = concatenate(&[a, b], 0)?;
assert_eq!(c.shape(), [3, 2]);
assert_eq!(c.to_vec::<f32>()?, [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]);