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

Method __init__

axlearn/common/bert.py:114–120  ·  view source on GitHub ↗
(self, cfg: Config, *, parent: Optional[Module])

Source from the content-addressed store, hash-verified

112 norm: InstantiableConfig = LayerNorm.default_config()
113
114 def __init__(self, cfg: Config, *, parent: Optional[Module]):
115 super().__init__(cfg, parent=parent)
116 cfg = self.config
117 self._add_child(
118 "linear", cfg.linear.set(input_dim=cfg.input_dim, output_dim=cfg.output_dim)
119 )
120 self._add_child("norm", cfg.norm.set(input_dim=cfg.output_dim))
121
122 def forward(self, inputs: Tensor) -> Tensor:
123 """Applies a non-linear transform to the inputs.

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

_add_childMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected