@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_op={}_shape={}_k={}'.format(op, jtu.format_shape_dtype_string(shape, dtype), k), 'dtype': dtype, 'shape': shape, 'op': op, 'k': k, 'rng_factory': jtu.rand_default} for dtype in default_dtypes for shape in [shape for shape in all_shapes if (len(shape) >= 2)] for op in ['tril', 'triu'] for k in list(range((- 3), 3)))))
def testTriLU(self, dtype, shape, op, k, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda arg: getattr(onp, op)(arg, k=k))
    jnp_fun = (lambda arg: getattr(jnp, op)(arg, k=k))
    args_maker = (lambda : [rng(shape, dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)
@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_op={}_shape={}_k={}'.format(op, jtu.format_shape_dtype_string(shape, dtype), k), 'dtype': dtype, 'shape': shape, 'op': op, 'k': k, 'rng_factory': jtu.rand_default} for dtype in default_dtypes for shape in [shape for shape in all_shapes if (len(shape) >= 2)] for op in ['tril', 'triu'] for k in list(range((- 3), 3)))))
def testTriLU(self, dtype, shape, op, k, rng_factory):
    rng = rng_factory()
    onp_fun = (lambda arg: getattr(onp, op)(arg, k=k))
    jnp_fun = (lambda arg: getattr(jnp, op)(arg, k=k))
    args_maker = (lambda : [rng(shape, dtype)])
    self._CheckAgainstNumpy(onp_fun, jnp_fun, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_fun, args_maker, check_dtypes=True)