(x, ind)
| 1126 | ind = mx.array([0, 1, 0]).astype(mx.float32) |
| 1127 | |
| 1128 | def index_fn(x, ind): |
| 1129 | return x[ind.astype(mx.int32)].sum() |
| 1130 | |
| 1131 | grad_x, grad_ind = mx.grad(index_fn, argnums=(0, 1))(x, ind) |
| 1132 | expected = mx.array([[2, 2], [1, 1]]) |
nothing calls this directly
no outgoing calls
no test coverage detected