MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _constant_if_small

Function _constant_if_small

tensorflow/python/ops/array_ops.py:2292–2299  ·  view source on GitHub ↗
(value, shape, dtype, name)

Source from the content-addressed store, hash-verified

2290
2291
2292def _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")

Callers 2

zerosFunction · 0.85
onesFunction · 0.85

Calls 1

constantFunction · 0.90

Tested by

no test coverage detected