MCPcopy
hub / github.com/OpenPPL/ppq / push

Method push

ppq/quantization/algorithm/training.py:112–116  ·  view source on GitHub ↗
(self, tensor: torch.Tensor, is_reference: bool)

Source from the content-addressed store, hash-verified

110 self.random_fetch = random_fetch
111
112 def push(self, tensor: torch.Tensor, is_reference: bool) -> None:
113 if self.random_fetch:
114 tensor = batch_random_fetch(tensor, seed=self.seed, fetches_per_batch=self.fetchs)
115 if is_reference: self.references.append(tensor)
116 else: self.outputs.append(tensor)
117
118 def pop(self) -> Tuple[torch.Tensor]:
119 assert len(self.outputs) == len(self.references), ('Inconsistent samples detected.'

Callers

nothing calls this directly

Calls 2

batch_random_fetchFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected