@parameterized.named_parameters(({'testcase_name': '_from={}_to={}'.format(from_shape, to_shape), 'rng_factory': rng_factory, 'from_shape': from_shape, 'to_shape': to_shape} for (from_shape, to_shape) in [[(1, 3), (4, 3)], [(3,), (2, 1, 3)], [(3,), (3, 3)], [(1,), (3,)]] for rng_factory in [jtu.rand_default]))
def testBroadcastTo(self, from_shape, to_shape, rng_factory):
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng, [from_shape], [onp.float32])
    onp_op = (lambda x: onp.broadcast_to(x, to_shape))
    jnp_op = (lambda x: jnp.broadcast_to(x, to_shape))
    self._CheckAgainstNumpy(onp_op, jnp_op, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_op, args_maker, check_dtypes=True)
@parameterized.named_parameters(({'testcase_name': '_from={}_to={}'.format(from_shape, to_shape), 'rng_factory': rng_factory, 'from_shape': from_shape, 'to_shape': to_shape} for (from_shape, to_shape) in [[(1, 3), (4, 3)], [(3,), (2, 1, 3)], [(3,), (3, 3)], [(1,), (3,)]] for rng_factory in [jtu.rand_default]))
def testBroadcastTo(self, from_shape, to_shape, rng_factory):
    rng = rng_factory()
    args_maker = self._GetArgsMaker(rng, [from_shape], [onp.float32])
    onp_op = (lambda x: onp.broadcast_to(x, to_shape))
    jnp_op = (lambda x: jnp.broadcast_to(x, to_shape))
    self._CheckAgainstNumpy(onp_op, jnp_op, args_maker, check_dtypes=True)
    self._CompileAndCheck(jnp_op, args_maker, check_dtypes=True)