mlx-bun library API
    Preparing search index...

    A reusable value-and-grad over a JS-built loss graph.

    loss(primals) receives the input arrays in argument order and must return a single SCALAR MlxArray (the loss). The graph it builds is differentiated w.r.t. the inputs named in argIdx. apply(primals) returns the loss value and exactly argIdx.length gradients (one per differentiated input, in argIdx order).

    The closure must not throw; if the user loss throws, the error is captured and surfaced from apply(). The MlxArrays handed to loss are owned by mlx — do NOT dispose them; the returned loss IS disposed of by mlx's graph.

    Index