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

Method test_module_state

python/tests/test_nn.py:190–193  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 self.assertEqual(len(m.layers), 1)
189
190 def test_module_state(self):
191 m = nn.Linear(10, 1)
192 m.state["hello"] = "world"
193 self.assertEqual(m.state["hello"], "world")
194
195 def test_chaining(self):
196 m = nn.Sequential(nn.Linear(2, 2), nn.ReLU(), nn.Linear(2, 1))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected