(value, shape, dtype, name)
| 2290 | |
| 2291 | |
| 2292 | def _constant_if_small(value, shape, dtype, name): |
| 2293 | try: |
| 2294 | if np.prod(shape) < 1000: |
| 2295 | return constant(value, shape=shape, dtype=dtype, name=name) |
| 2296 | except TypeError: |
| 2297 | # Happens when shape is a Tensor, list with Tensor elements, etc. |
| 2298 | pass |
| 2299 | return None |
| 2300 | |
| 2301 | |
| 2302 | @tf_export("zeros") |