def METHOD_NAME():
    init_was_called = {}
    def register_init(name, model, X=None, Y=None):
        init_was_called[name] = True
    layer1 = Linear(5)
    layer2 = Linear(5)
    layer3 = Linear(5)
    layer1.init = partial(register_init, "one")
    layer2.init = partial(register_init, "two")
    layer3.init = partial(register_init, "three")
    # This is the nesting we'll get from operators.
    model = chain(layer1, chain(layer2, layer3))
    assert not init_was_called
    model.initialize()
    assert init_was_called["one"]
    assert init_was_called["two"]
    assert init_was_called["three"]