diff --git a/compiler/lib/Bindings/Rust/src/compiler.rs b/compiler/lib/Bindings/Rust/src/compiler.rs index 87d7d14e7..cca234590 100644 --- a/compiler/lib/Bindings/Rust/src/compiler.rs +++ b/compiler/lib/Bindings/Rust/src/compiler.rs @@ -781,6 +781,34 @@ impl LambdaArgument { } } + pub fn from_tensor_u16(data: &[u16], dims: &[i64]) -> Result { + unsafe { + let arg = LambdaArgument::wrap(ffi::lambdaArgumentFromTensorU16( + data.as_ptr(), + dims.as_ptr(), + dims.len().try_into().unwrap(), + )); + if arg.is_null() { + return Err(CompilerError(arg.error_msg())); + } + Ok(arg) + } + } + + pub fn from_tensor_u32(data: &[u32], dims: &[i64]) -> Result { + unsafe { + let arg = LambdaArgument::wrap(ffi::lambdaArgumentFromTensorU32( + data.as_ptr(), + dims.as_ptr(), + dims.len().try_into().unwrap(), + )); + if arg.is_null() { + return Err(CompilerError(arg.error_msg())); + } + Ok(arg) + } + } + pub fn from_tensor_u64(data: &[u64], dims: &[i64]) -> Result { unsafe { let arg = LambdaArgument::wrap(ffi::lambdaArgumentFromTensorU64(