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

Function collate_fn

ppq/samples/Tutorial/bestPractice.py:17–18  ·  view source on GitHub ↗
(batch: torch.Tensor)

Source from the content-addressed store, hash-verified

15CALIBRATION = [torch.rand(size=INPUT_SHAPE) for _ in range(32)]
16QS = QuantizationSettingFactory.default_setting()
17def collate_fn(batch: torch.Tensor) -> torch.Tensor:
18 return batch.to(DEVICE)
19
20model = torchvision.models.mobilenet.mobilenet_v2(pretrained=True)
21model = model.to(DEVICE)

Callers 1

bestPractice.pyFile · 0.70

Calls 1

toMethod · 0.80

Tested by

no test coverage detected