@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_{}'.format('_'.join((jtu.format_shape_dtype_string(shape, dtype) for (shape, dtype) in zip(shapes, dtypes)))), 'rng_factory': jtu.rand_default, 'shapes': shapes, 'dtypes': dtypes} for shapes in filter(_shapes_are_broadcast_compatible, CombosWithReplacement(all_shapes, 3)) for dtypes in CombosWithReplacement(all_dtypes, 3))))
def testWhereThreeArgument(self, rng_factory, shapes, dtypes):
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng_factory(), shapes, dtypes)

    def onp_fun(cond, x, y):
        return _promote_like_jnp(partial(onp.where, cond))(x, y)
    self._CheckAgainstNumpy(onp_fun, jnp.where, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp.where, args_maker, check_dtypes=True)
@parameterized.named_parameters(jtu.cases_from_list(({'testcase_name': '_{}'.format('_'.join((jtu.format_shape_dtype_string(shape, dtype) for (shape, dtype) in zip(shapes, dtypes)))), 'rng_factory': jtu.rand_default, 'shapes': shapes, 'dtypes': dtypes} for shapes in filter(_shapes_are_broadcast_compatible, CombosWithReplacement(all_shapes, 3)) for dtypes in CombosWithReplacement(all_dtypes, 3))))
def testWhereThreeArgument(self, rng_factory, shapes, dtypes):
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng_factory(), shapes, dtypes)

    def onp_fun(cond, x, y):
        return _promote_like_jnp(partial(onp.where, cond))(x, y)
    self._CheckAgainstNumpy(onp_fun, jnp.where, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp.where, args_maker, check_dtypes=True)