INNER CODE UNIT · Rust

d

sonos/tract · api/ffi/src/lib.rs:1543

        let d = (*fact).0.dim(axis)?;
        *dim = Box::into_raw(Box::new(TractDim(d)));
        Ok(())
    })
}

/// Write a fact as its specification string.
///
/// The returned string must be freed by the caller using tract_free_cstring.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn tract_fact_dump(
    fact: *const TractFact,
    spec: *mut *mut c_char,
) -> TRACT_RESULT {
    wrap(|| unsafe {
        check_not_null!(fact, spec);
        *spec = CString::new(format!("{}", (*fact).0))?.into_raw();
        Ok(())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…