MCPcopy Index your code
hub / github.com/FlashSampling/FlashSampling / compute_logits

Method compute_logits

src/fused_mm_sampling/core.py:711–716  ·  view source on GitHub ↗
(
        self,
        hidden_states: torch.Tensor,  # [n_hidden_states, D]
    )

Source from the content-addressed store, hash-verified

709 return samples
710
711 def compute_logits(
712 self,
713 hidden_states: torch.Tensor, # [n_hidden_states, D]
714 ) -> torch.Tensor:
715 h_p = hidden_states @ self.rand_mat # [n_hidden_states, k]
716 return h_p @ self.w_p.T # [n_hidden_states, V]
717
718 def rrt(self) -> torch.Tensor:
719 """Return R @ Rᵀ, which should be close to the identity matrix."""

Callers 2

sampleMethod · 0.95

Calls

no outgoing calls

Tested by 1