generators should not be accepted as values for the shape argument of numpy functions
```python3
import numpy as np
shape = (1 for _ in range(4)) 
np.zeros(shape)
```

results in `TypeError: expected sequence object with len >= 0 or a single integer`

whereas

```python3
import jax.numpy as np
shape = (1 for _ in range(4)) 
np.zeros(shape)
```

just runs through and produces `array([[[[0.]]]], dtype=float32)`.
This however can lead to bugs that are hard to find, because calling `np.zeros(shape)` a second time will create `array(0., dtype=float32)`

Conclusion: `jax.numpy` should behave like `numpy` and should also through a TypeError
diff --git a/jax/numpy/lax_numpy.py b/jax/numpy/lax_numpy.py
index de22537ce..20f7be4a9 100644
--- a/jax/numpy/lax_numpy.py
+++ b/jax/numpy/lax_numpy.py
@@ -21,6 +21,7 @@ import itertools
 import re
 import string
 import warnings
+import types
 
 import numpy as onp
 import opt_einsum
@@ -1221,6 +1222,8 @@ def full_like(a, fill_value, dtype=None):
 
 @_wraps(onp.zeros)
 def zeros(shape, dtype=onp.dtype("float64")):
+  if isinstance(shape, types.GeneratorType):
+    raise TypeError("expected sequence object with len >= 0 or a single integer")
   shape = (shape,) if onp.isscalar(shape) else shape
   return lax.full(shape, 0, dtype)
 
['jax/numpy/lax_numpy.py']