use crate::{Matrix, Result, Runtime};
pub fn from_f32(shape: impl Into<Vec<usize>>, values: &[f32]) -> Result<Matrix> {
let shape = shape.into();
from_f32_on(&Runtime::current()?, shape, values)
}
pub fn from_f32_on(
runtime: &Runtime,
shape: impl Into<Vec<usize>>,
values: &[f32],
) -> Result<Matrix> {
Matrix::new_from_f32_on(runtime, shape, values)
}
pub fn ones(shape: impl Into<Vec<usize>>) -> Result<Matrix> {
let shape = shape.into();
ones_on(&Runtime::current()?, shape)
}
pub fn ones_on(runtime: &Runtime, shape: impl Into<Vec<usize>>) -> Result<Matrix> {
Matrix::filled_f32(runtime, shape, 1.0)
}
pub fn full(shape: impl Into<Vec<usize>>, value: f32) -> Result<Matrix> {
let shape = shape.into();
full_on(&Runtime::current()?, shape, value)
}
pub fn full_on(runtime: &Runtime, shape: impl Into<Vec<usize>>, value: f32) -> Result<Matrix> {
Matrix::filled_f32(runtime, shape, value)
}