diff --git a/pina/dataset.py b/pina/dataset.py index 1cf2f96..38b2200 100644 --- a/pina/dataset.py +++ b/pina/dataset.py @@ -238,3 +238,12 @@ class SamplePointLoader: 'condition': self.batch_data_conditions[idx_], } yield d + + def __len__(self): + """ + Return the number of batches. + + :return: The number of batches. + :rtype: int + """ + return len(self.batch_list) \ No newline at end of file