MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / compress_module

Function compress_module

robohusky/compression.py:52–62  ·  view source on GitHub ↗
(module, target_device)

Source from the content-addressed store, hash-verified

50
51
52def compress_module(module, target_device):
53 for attr_str in dir(module):
54 target_attr = getattr(module, attr_str)
55 if type(target_attr) == torch.nn.Linear:
56 setattr(
57 module,
58 attr_str,
59 CLinear(target_attr.weight, target_attr.bias, target_device),
60 )
61 for name, child in module.named_children():
62 compress_module(child, target_device)
63
64
65def get_compressed_list(module, prefix=""):

Callers 3

load_modelFunction · 0.90
load_modelFunction · 0.90
load_modelFunction · 0.90

Calls 1

CLinearClass · 0.85

Tested by 1

load_modelFunction · 0.72