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

Function _shape_tensor

tensorflow/python/ops/stateful_random_ops.py:154–160  ·  view source on GitHub ↗

Convert to an int32 or int64 tensor, defaulting to int64 if empty.

(shape)

Source from the content-addressed store, hash-verified

152
153
154def _shape_tensor(shape):
155 """Convert to an int32 or int64 tensor, defaulting to int64 if empty."""
156 if isinstance(shape, (tuple, list)) and not shape:
157 dtype = dtypes.int64
158 else:
159 dtype = None
160 return ops.convert_to_tensor(shape, dtype=dtype, name="shape")
161
162
163def _convert_to_state_tensor(t):

Callers 5

normalMethod · 0.85
truncated_normalMethod · 0.85
uniformMethod · 0.85
uniform_full_intMethod · 0.85
binomialMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected