Skip to content

Commit e0e4791

Browse files
Volodymyr OrlovVolodymyr Orlov
authored andcommitted
fix: bug in dataset serializer
1 parent 7c013dd commit e0e4791

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dataset/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::io;
1212
use std::io::prelude::*;
1313

1414
/// Dataset
15+
#[derive(Debug)]
1516
pub struct Dataset<X, Y> {
1617
/// data in one-dimensional array.
1718
pub data: Vec<X>,
@@ -102,6 +103,7 @@ pub(crate) fn deserialize_data(
102103
for _ in 0..(num_samples) {
103104
buffer.copy_from_slice(&bytes[c..(c + 4)]);
104105
y.push(f32::from_bits(u32::from_le_bytes(buffer)));
106+
c += 4;
105107
}
106108

107109
Ok((x, y, num_samples, num_features))

0 commit comments

Comments
 (0)