MCPcopy
hub / github.com/microsoft/Cream / set_epoch

Method set_epoch

TinyViT/data/sampler.py:148–157  ·  view source on GitHub ↗

r""" Sets the epoch for this sampler. When :attr:`shuffle=True`, this ensures all replicas use a different random ordering for each epoch. Otherwise, the next iteration of this sampler will yield the same ordering. Args: epoch (int): Epoch number.

(self, epoch: int)

Source from the content-addressed store, hash-verified

146 return self.num_samples
147
148 def set_epoch(self, epoch: int) -> None:
149 r"""
150 Sets the epoch for this sampler. When :attr:`shuffle=True`, this ensures all replicas
151 use a different random ordering for each epoch. Otherwise, the next iteration of this
152 sampler will yield the same ordering.
153
154 Args:
155 epoch (int): Epoch number.
156 """
157 self.epoch = epoch

Callers 2

mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected