

def test_cast_to_int():
    inds = np.ones(5)[:, None]

    def fun(W):
        glued_together = np.concatenate((W, inds), axis=1)
        new_W = W[:, :(- 1)]
        new_inds = np.int64(W[:, (- 1)])
        assert (new_inds.dtype == np.int64)
        return new_W[new_inds].sum()
    W = np.random.randn(5, 10)
    check_grads(fun, inds)

dataset/ETHPy150Open HIPS/autograd/tests/test_numpy.py test_cast_to_int/VarMisuse@118/131 `W`->`inds`