MCPcopy
hub / github.com/lm-sys/FastChat / __init__

Method __init__

fastchat/model/compression.py:42–50  ·  view source on GitHub ↗
(self, weight=None, bias=None, device=None)

Source from the content-addressed store, hash-verified

40 """Compressed Linear Layer."""
41
42 def __init__(self, weight=None, bias=None, device=None):
43 super().__init__()
44 if weight is None:
45 self.weight = None
46 elif isinstance(weight, Tensor):
47 self.weight = compress(weight.data.to(device), default_compression_config)
48 else:
49 self.weight = weight
50 self.bias = bias
51
52 def forward(self, input: Tensor) -> Tensor:
53 weight = decompress(self.weight, default_compression_config)

Callers

nothing calls this directly

Calls 2

compressFunction · 0.85
toMethod · 0.80

Tested by

no test coverage detected