np.broadcast_to regression in the latest JAX version
The new version 0.1.47 introduces a regression where `np.broadcast_to(1, (3, 2))` throws the error `AttributeError: 'int' object has no attribute 'ndim'`.

cc @mattjj @neerajprad
diff --git a/jax/lax/lax.py b/jax/lax/lax.py
index fe895aa1e..0a648671b 100644
--- a/jax/lax/lax.py
+++ b/jax/lax/lax.py
@@ -599,7 +599,7 @@ def broadcast(operand, sizes):
   return broadcast_p.bind(operand, sizes=tuple(sizes))
 
 def broadcast_in_dim(operand, shape, broadcast_dimensions):
-  if operand.ndim == len(shape) and not len(broadcast_dimensions):
+  if onp.ndim(operand) == len(shape) and not len(broadcast_dimensions):
     return operand
   if any(x < 0 or x >= len(shape) for x in broadcast_dimensions):
     msg = ("broadcast dimensions must be >= 0 and < ndim(shape), got {} for "
diff --git a/tests/lax_numpy_test.py b/tests/lax_numpy_test.py
index 305bfe6ae..c7974658f 100644
--- a/tests/lax_numpy_test.py
+++ b/tests/lax_numpy_test.py
@@ -1952,6 +1952,10 @@ class LaxBackedNumpyTests(jtu.JaxTestCase):
         ValueError, "Incompatible shapes for broadcasting: .*",
         lambda: lnp.broadcast_to(onp.ones((2, 3)), (1, 3)))
 
+  def testBroadcastToIntIssue1548(self):
+    self.assertAllClose(lnp.broadcast_to(1, (3, 2)), onp.ones((3, 2)),
+                        check_dtypes=False)
+
 # Most grad tests are at the lax level (see lax_test.py), but we add some here
 # as needed for e.g. particular compound ops of interest.
 
['tests/lax_numpy_test.py', 'jax/lax/lax.py']