<< " by the upper layers";
size_t num = datum_vector.size();
CHECK_GT(num, 0) << "There is no datum to add";
- CHECK_LE(num % batch_size_, 0) <<
+ CHECK_EQ(num % batch_size_, 0) <<
"The number of added datum must be multiple of the batch size";
- if (num > batch_size_) {
- added_data_.Reshape(num, channels_, height_, width_);
- added_label_.Reshape(num, 1, 1, 1);
- }
+ added_data_.Reshape(num, channels_, height_, width_);
+ added_label_.Reshape(num, 1, 1, 1);
// Apply data transformations (mirror, scale, crop...)
this->data_transformer_.Transform(datum_vector, &added_data_);
// Copy Labels
CHECK(!has_new_data_) <<
"Can't add Mat when earlier ones haven't been consumed"
<< " by the upper layers";
- CHECK_LE(num % batch_size_, 0) <<
+ CHECK_EQ(num % batch_size_, 0) <<
"The number of added datum must be multiple of the batch size";
CHECK_GT(num, 0) << "There is no mat to add";
- if (num > batch_size_) {
- added_data_.Reshape(num, channels_, height_, width_);
- added_label_.Reshape(num, 1, 1, 1);
- }
+ added_data_.Reshape(num, channels_, height_, width_);
+ added_label_.Reshape(num, 1, 1, 1);
// Apply data transformations (mirror, scale, crop...)
this->data_transformer_.Transform(mat_vector, &added_data_);
// Copy Labels
for (int c = 0; c < this->channels_; ++c) {
data_index = (i*count) + (c * this->height_ + h) * this->width_ + w;
Dtype pixel = static_cast<Dtype>(ptr_mat[index++]);
- EXPECT_EQ(static_cast<int>(pixel),
- data[data_index]);
+ EXPECT_EQ(static_cast<int>(pixel), data[data_index]);
}
}
}
for (int c = 0; c < this->channels_; ++c) {
data_index = (i*count) + (c * this->height_ + h) * this->width_ + w;
Dtype pixel = static_cast<Dtype>(ptr_mat[index++]);
- EXPECT_EQ(static_cast<int>(pixel),
- data[data_index]);
+ EXPECT_EQ(static_cast<int>(pixel), data[data_index]);
}
}
}