MCPcopy Index your code
hub / github.com/OpenPPL/ppq / collate_fn

Function collate_fn

ppq/samples/Tutorial/quantize.py:31–32  ·  view source on GitHub ↗
(batch: dict)

Source from the content-addressed store, hash-verified

29 return dataset, sample # last sample
30
31def collate_fn(batch: dict) -> torch.Tensor:
32 return {k: v.to(DEVICE) for k, v in batch.items()}
33
34# ------------------------------------------------------------
35# 在这里,我们仍然创建一个 QuantizationSetting 对象用来管理量化过程

Callers 1

quantize.pyFile · 0.70

Calls 1

toMethod · 0.80

Tested by

no test coverage detected