MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __iter__

Method __iter__

PATH/core/distributed_utils.py:1033–1050  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1031 self.flag = self.sampler.flag
1032
1033 def __iter__(self):
1034 ret = []
1035 batch = []
1036 #from IPython import embed;embed()
1037 for idx in self.sampler:
1038 batch.append(idx)
1039 if len(batch) == self.batch_size:
1040 batch = tuple(batch)
1041 for i in batch:
1042 if self.flag[i]!=self.flag[batch[0]]:
1043 import pdb; pdb.set_trace()
1044 # from IPython import embed;embed()
1045 ret.extend(batch)
1046 batch = []
1047 if len(batch) > 0 and not self.drop_last:
1048 ret.extend(batch)
1049
1050 return iter(ret)
1051
1052 def __len__(self):
1053 # Can only be called if self.sampler has __len__ implemented

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected