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

Function collate_fn

ppq/samples/enable_cuda_kernel.py:23–24  ·  view source on GitHub ↗
(batch: torch.Tensor)

Source from the content-addressed store, hash-verified

21 return [torch.rand(size=INPUT_SHAPE) for _ in range(32)]
22
23def collate_fn(batch: torch.Tensor) -> torch.Tensor:
24 return batch.to(DEVICE)
25
26# Load a pretrained mobilenet v2 model
27model = torchvision.models.mobilenet.mobilenet_v2(pretrained=True)

Callers

nothing calls this directly

Calls 1

toMethod · 0.80

Tested by

no test coverage detected