improve __len__ for GroupedBatchSampler (fix
Summary: Pull Request resolved:
@@ -42,3 +42,6 @@ class GroupedBatchSampler(BatchSampler):
if len(group_buffer) == self.batch_size:
yield group_buffer[:] # yield a copy of the list
del group_buffer[:]
+
+ def __len__(self):
+ raise NotImplementedError("len() of GroupedBatchSampler is not well-defined.")
