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

Method __init__

robohusky/compression.py:35–43  ·  view source on GitHub ↗
(self, weight=None, bias=None, device=None)

Source from the content-addressed store, hash-verified

33 """Compressed Linear Layer."""
34
35 def __init__(self, weight=None, bias=None, device=None):
36 super().__init__()
37 if weight is None:
38 self.weight = None
39 elif isinstance(weight, Tensor):
40 self.weight = compress(weight.data.to(device), default_compression_config)
41 else:
42 self.weight = weight
43 self.bias = bias
44
45 def forward(self, input: Tensor) -> Tensor:
46 weight = decompress(self.weight, default_compression_config)

Callers

nothing calls this directly

Calls 1

compressFunction · 0.85

Tested by

no test coverage detected