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

Method __init__

axlearn/common/layers.py:1479–1489  ·  view source on GitHub ↗
(self, cfg: Config, *, parent: Module)

Source from the content-addressed store, hash-verified

1477 super().__init__(cfg, parent=parent)
1478 cfg = self.config
1479 self._add_child(
1480 "spatial",
1481 cfg.spatial_embeddings.set(dim=cfg.dim),
1482 )
1483 self._add_child(
1484 "temporal",
1485 cfg.temporal_embeddings.set(dim=cfg.dim),
1486 )
1487
1488 @property
1489 def num_spatial_embeddings(self) -> int:
1490 return self.spatial.embeddings().shape[0]
1491
1492 @property

Callers

nothing calls this directly

Calls 3

_add_childMethod · 0.80
__init__Method · 0.45
setMethod · 0.45

Tested by

no test coverage detected