MCPcopy Create free account
hub / github.com/ml-explore/mlx / MyModel

Class MyModel

python/tests/test_nn.py:324–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322
323 # Using leaf_modules in the update should always work
324 class MyModel(nn.Module):
325 def __init__(self):
326 super().__init__()
327 self.stuff = [nn.Linear(2, 2), 0, nn.Linear(2, 2)]
328 self.more_stuff = {"hi": nn.Linear(2, 2), "bye": 0}
329
330 m = MyModel()
331 m.update_modules(m.leaf_modules())

Callers 1

test_update_modulesMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_update_modulesMethod · 0.68