Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not really related to #530. In addition to that issue the parsing of CSV files has been broken by the laser backend PR, due to the change away from the
Fdata
field name. That name was still in use for the CSV parser.While changing this I stumbled over some issues with how to handle the parsing now. Due to having non
seq[T]
based tensors for mem copyable types, we would have to always copy from the parsedseq[T]
data to a tensor. I thought the better solution would be to instead walk the file once first to determine the number of lines and columns and then already construct an appropriate tensor. Then just fill it in a second pass using the CSV parser. Ideally, we should parse directly using the memfiles interface, but that's a lot more work.From the datamancer CSV parser (which uses memfiles) I know that checking for line count before starting to parse is fast enough (it pays off compared to reallocations).