AQIT 0.1.0
Loading...
Searching...
No Matches
attention_routing.py File Reference

Go to the source code of this file.

Namespaces

namespace  aquin
namespace  aquin.compute
namespace  aquin.compute.attention_routing

Functions

int aquin.compute.attention_routing._count_induction_pairs (list[int] token_ids)
tuple[float, float] aquin.compute.attention_routing._score_head (torch.Tensor pattern, list[int] token_ids)
list[dict] aquin.compute.attention_routing._heads_from_pattern_stack (list[tuple[int, torch.Tensor]] patterns, list[int] token_ids)
list[tuple[int, torch.Tensor]] aquin.compute.attention_routing._patterns_from_tl_cache (Any model, torch.Tensor tokens, int n_layers)
tuple[list[tuple[int, torch.Tensor]], str|None] aquin.compute.attention_routing._patterns_from_hf_output_attentions (Any model, torch.Tensor tokens)
dict aquin.compute.attention_routing.run_attention_routing (Any model, str prompt, *, int top_k=5, str model_id="")