mlx_rs::ops

Function at_least_1d

Source
pub fn at_least_1d(a: impl AsRef<Array>) -> Result<Array>
Expand description

Convert array to have at least one dimension.

§Params

  • a: The input array.

§Example

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

let x = Array::from_int(1);
let out = at_least_1d(&x);