Skip to content

Commit

Permalink
Minor fix to correctly calculate F16 buffer size (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjjones authored Nov 22, 2022
1 parent be5fc4c commit c17b5b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion image2tensor/src/image2tensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn save_bytes(arr: &[u8], tt: TensorType) -> Vec<u8> {
fn get_bytes_per_pixel(precision: TensorType) -> usize {
match precision {
TensorType::F32 | TensorType::I32 => 4,
TensorType::F16 => 2,
TensorType::F16 => 4, // Currently Rust doesn't support F16 natively, so we use f32.
TensorType::U8 => 1,
}
}
Expand Down

0 comments on commit c17b5b8

Please sign in to comment.