Skip to content

Commit

Permalink
Format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Staib Matilla committed Jan 14, 2025
1 parent 915e67f commit f91ae61
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::vector<std::vector<unsigned char>> SingleSampleFileWrapper::get_samples(uin
}

std::vector<std::vector<unsigned char>> SingleSampleFileWrapper::get_samples_from_indices(
const std::vector<uint64_t>& indices, bool include_labels) {
const std::vector<uint64_t>& indices, bool /*include_labels*/) {
ASSERT(indices.size() == 1 && indices[0] == 0,
fmt::format("Single sample file wrappers can only access the first sample. file_path = {}, indices.size() = "
"{}, indices = [{}]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,33 +295,33 @@ TEST_F(BinaryFileWrapperTest, TestGetSamplesFromIndices) {

BinaryFileWrapper file_wrapper(file_name_, config_, filesystem_wrapper_);
std::vector<uint64_t> label_indices{0, 1, 2, 3};
std::vector<std::vector<unsigned char>> samples = file_wrapper.get_samples_from_indices(label_indices, true);
std::vector<std::vector<unsigned char>> samples = file_wrapper.get_samples_from_indices(label_indices, /*include_labels=*/true);
ASSERT_EQ(samples.size(), 4);
ASSERT_EQ((samples)[0][0], 12);
ASSERT_EQ((samples)[1][0], 13);
ASSERT_EQ((samples)[2][0], 14);
ASSERT_EQ((samples)[3][0], 15);

label_indices = {1, 2, 3};
samples = file_wrapper.get_samples_from_indices(label_indices, true);
samples = file_wrapper.get_samples_from_indices(label_indices, /*include_labels=*/true);
ASSERT_EQ(samples.size(), 3);
ASSERT_EQ((samples)[0][0], 13);
ASSERT_EQ((samples)[1][0], 14);
ASSERT_EQ((samples)[2][0], 15);

label_indices = {2};
samples = file_wrapper.get_samples_from_indices(label_indices, true);
samples = file_wrapper.get_samples_from_indices(label_indices, /*include_labels=*/true);
ASSERT_EQ(samples.size(), 1);
ASSERT_EQ((samples)[0][0], 14);

label_indices = {1, 3};
samples = file_wrapper.get_samples_from_indices(label_indices, true);
samples = file_wrapper.get_samples_from_indices(label_indices, /*include_labels=*/true);
ASSERT_EQ(samples.size(), 2);
ASSERT_EQ((samples)[0][0], 13);
ASSERT_EQ((samples)[1][0], 15);

label_indices = {3, 1, 3};
samples = file_wrapper.get_samples_from_indices(label_indices, true);
samples = file_wrapper.get_samples_from_indices(label_indices, /*include_labels=*/true);
ASSERT_EQ(samples.size(), 3);
ASSERT_EQ((samples)[0][0], 15);
ASSERT_EQ((samples)[1][0], 13);
Expand Down

0 comments on commit f91ae61

Please sign in to comment.