

def test_triu():

    def fun(x):
        return to_scalar(np.triu(x, k=2))
    d_fun = (lambda x: to_scalar(grad(fun)(mat)))
    mat = npr.randn(5, 5)
    check_grads(fun, mat)
    check_grads(d_fun, mat)

dataset/ETHPy150Open HIPS/autograd/tests/test_numpy.py test_triu/VarMisuse@47/56 `x`->`mat`