Coverage for transformer_lens/tools/analysis/__init__.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.10.1, created at 2026-07-01 15:58 +0000

1"""Analysis tools for TransformerLens. 

2 

3This subpackage collects high-level, single-call interpretability analyses that 

4sit on top of the hook/cache system. They work with both ``HookedTransformer`` 

5and the newer ``TransformerBridge`` (the two share the ``ActivationCache`` API). 

6 

7Tools: 

8 - direct_logit_attribution: Direct Logit Attribution (DLA) over components, 

9 layers, or attention heads. 

10 - direct_path_patching: Direct path patching for head-to-head circuit 

11 analysis. 

12""" 

13 

14from transformer_lens.tools.analysis.direct_logit_attribution import ( 

15 DirectLogitAttribution, 

16 direct_logit_attribution, 

17) 

18from transformer_lens.tools.analysis.direct_path_patching import ( 

19 get_act_patch_direct_path, 

20 get_act_patch_direct_path_all_sources, 

21) 

22 

23__all__ = [ 

24 "DirectLogitAttribution", 

25 "direct_logit_attribution", 

26 "get_act_patch_direct_path", 

27 "get_act_patch_direct_path_all_sources", 

28]