MCPcopy Create free account
hub / github.com/arcee-ai/DistillKit / ErrorStats

Class ErrorStats

test_compression.py:21–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class ErrorStats(BaseModel):
22 mean: float
23 std: float
24 max: float
25 min: float
26
27 @classmethod
28 def from_tensor(cls, tensor: torch.Tensor) -> "ErrorStats":
29 return cls(
30 mean=tensor.mean().item(),
31 std=tensor.std().item(),
32 max=tensor.max().item(),
33 min=tensor.min().item(),
34 )
35
36 def __str__(self):
37 return (
38 f"mean: {self.mean:.4e}, "
39 f"std: {self.std:.4e}, "
40 f"max: {self.max:.4e}, "
41 f"min: {self.min:.4e}"
42 )
43
44
45class CompressionEvalResult(BaseModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected