Skip to content

Commit

Permalink
fix(mnn): Fix the issue with compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
uttarayan21 committed Nov 5, 2024
1 parent 0289b0e commit a0cee90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,16 @@ impl Interpreter {
/// # Safety
/// Very **unsafe** since it doesn't check the type of the tensor
/// as well as the shape of the tensor
///
/// **Panics** if the name is not ascii
/// **Undefined Behavior** if the tensor is not of type `H`
pub unsafe fn input_unchecked<'s, H: HalideType>(
&self,
session: &'s crate::Session,
name: impl AsRef<str>,
) -> Tensor<RefMut<'s, Device<H>>> {
let name = name.as_ref();
let c_name = std::ffi::CString::new(name).change_context(ErrorKind::AsciiError)?;
let c_name = std::ffi::CString::new(name).expect("Input tensor name is not ascii");
let input =
mnn_sys::Interpreter_getSessionInput(self.inner, session.inner, c_name.as_ptr());
Tensor::from_ptr(input)
Expand Down

0 comments on commit a0cee90

Please sign in to comment.