MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / prepare

Method prepare

src/fused_mm_sampling/core.py:679–690  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

677@dataclass
678class JLSampler(Sampler):
679 weights: torch.Tensor # [V, D]
680 k: int
681 prepared: bool = False
682
683 @classmethod
684 def from_weights(
685 cls,
686 weights: torch.Tensor, # [V, D]
687 epsilon: float = 0.2,
688 ) -> "JLSampler":
689 k = optimal_k(n=weights.shape[0], epsilon=epsilon)
690 print(f"JLSampler optimal k={k}")
691 return cls(weights, k=k)
692
693 def prepare(self) -> "JLSampler":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected