(name: str, module: torch.nn.Module, processors: Dict[str, AttentionProcessor])
| 127 | processors = {} |
| 128 | |
| 129 | def fn_recursive_add_processors(name: str, module: torch.nn.Module, processors: Dict[str, AttentionProcessor]): |
| 130 | if hasattr(module, "get_processor"): |
| 131 | processors[f"{name}.processor"] = module.get_processor() |
| 132 | |
| 133 | for sub_name, child in module.named_children(): |
| 134 | fn_recursive_add_processors(f"{name}.{sub_name}", child, processors) |
| 135 | |
| 136 | return processors |
| 137 | |
| 138 | for name, module in self.named_children(): |
| 139 | fn_recursive_add_processors(name, module, processors) |
nothing calls this directly
no outgoing calls
no test coverage detected