MCPcopy Create free account
hub / github.com/apple/axlearn / __init__

Method __init__

axlearn/common/lora.py:97–103  ·  view source on GitHub ↗
(self, cfg: Config, *, parent: Module)

Source from the content-addressed store, hash-verified

95 )
96
97 def __init__(self, cfg: Config, *, parent: Module):
98 super().__init__(cfg, parent=parent)
99 cfg = self.config
100 self._is_valid_config()
101 # Add on LoRA dropout layer.
102 # Drop out input randomly before passing to LoRA layers.
103 self._add_child("lora_dropout", cfg.dropout)
104
105 def forward(self, inputs: Tensor) -> Tensor:
106 outputs = self.lora_down(self.lora_dropout(inputs))

Callers

nothing calls this directly

Calls 3

_is_valid_configMethod · 0.95
_add_childMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected