MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / compress_module

Function compress_module

toolbench/model/compression.py:38–46  ·  view source on GitHub ↗
(module, target_device)

Source from the content-addressed store, hash-verified

36
37
38def compress_module(module, target_device):
39 for name, child in module.named_children():
40 if isinstance(child, nn.Linear):
41 setattr(
42 module,
43 name,
44 CLinear(child.weight, child.bias, target_device),
45 )
46 compress_module(child, target_device)
47
48
49def get_compressed_list(module, prefix=""):

Callers

nothing calls this directly

Calls 1

CLinearClass · 0.85

Tested by

no test coverage detected