Skip to content

Commit

Permalink
allow empty label in rowblackcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
mli committed Dec 27, 2015
1 parent f8027b0 commit 90c85d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/data/row_block.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ template<typename IndexType>
inline RowBlock<IndexType>
RowBlockContainer<IndexType>::GetBlock(void) const {
// consistency check
CHECK_EQ(label.size() + 1, offset.size());
if (label.size()) {
CHECK_EQ(label.size() + 1, offset.size());
}
CHECK_EQ(offset.back(), index.size());
CHECK(offset.back() == value.size() || value.size() == 0);
RowBlock<IndexType> data;
Expand Down

3 comments on commit 90c85d9

@tqchen
Copy link
Member

@tqchen tqchen commented on 90c85d9 Dec 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rule of label block now? if we allow empty labels. I can modify CSVParser to give empty label by default for now

@mli
Copy link
Member Author

@mli mli commented on 90c85d9 Dec 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label can be either null or should match the size of the rows. Though I still think the later is too strict and make something inconvenient if I use rowblock as the default sparse matrix format

@tqchen
Copy link
Member

@tqchen tqchen commented on 90c85d9 Dec 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let us make label to nullable in general, this might need more changes than what you have here

Please sign in to comment.