Closed chriamue closed 1 year ago
Sorry for not getting to this earlier. Note that autograph has and is going through some updates so this will be greatly improved. Internally the library had some methods to convert between FloatBuffer and Buffer, but I didn't end up exposing them! Anyway, FloatBuffer is an enum so you can just use a match / if let:
let buffer = if let FloatBuffer::F32(buffer) = prediction {
buffer
} else {
unreachable!()
};
Thanks for checking out my library! :)
Hi, I use the network defined in https://github.com/charles-r-earp/autograph/blob/main/examples/neural-network-mnist/src/main.rs The output of the model in inference as_raw_slice() is F32(BufferBase { device: Device(0), len: 14190, elem: "f32" }). Now I try to get a Vec<32> of it to interpret the results. Can you help me to understand how to get the data?
Here is a peace of code:
autograph=v0.1.1
Some examples show to "read" data back:
let output = y.read().await?;
But FloatBuffer does not have the read() function.