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

Method from_weights

src/fused_mm_sampling/core.py:670–677  ·  view source on GitHub ↗
(
        cls,
        weights: torch.Tensor,  # [V, D]
        epsilon: float = 0.2,
    )

Source from the content-addressed store, hash-verified

668 fn: Callable[..., torch.Tensor]
669
670 def prepare(self) -> "SimpleSampler":
671 return self
672
673 def sample(self, **kwargs) -> torch.Tensor:
674 return self.fn(**kwargs)
675
676
677@dataclass
678class JLSampler(Sampler):
679 weights: torch.Tensor # [V, D]
680 k: int

Callers 2

get_samplerFunction · 0.80

Calls 1

optimal_kFunction · 0.85

Tested by 1