INNER CODE UNIT · Rust
tensor
sonos/tract · api/ffi/src/lib.rs:1138
let tensor = &(*tensor).0;
let bits = tensor.as_bytes()?;
if !datum_type.is_null() {
*datum_type = bits.0;
}
if !rank.is_null() {
*rank = bits.1.len();
}
if !shape.is_null() {
*shape = bits.1.as_ptr();
}
if !data.is_null() {
*data = bits.2.as_ptr() as _;
}
Ok(())
})
}