uncertainty-baselines
uncertainty-baselines copied to clipboard
Fix a bug in SubsetDatasetBuilder (without failing the type checks hopefully)
The fix for SubsetDatasetBuilder that simply forwarded the info field actually breaks get_num_examples: it returns the total number of examples in the original dataset and not the subset.
This should fix that and simplify the code.
From a type checking perspective, this adds a generic typevar that bounds on the clu.deterministic_data.DatasetBuilder protocol. This should lead to the correct types being passed through in get_num_examples.
TODO: How do I run the Google-internal type checker externally?