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

Function _identity

tensorflow/python/ops/critical_section_ops.py:54–63  ·  view source on GitHub ↗

Identity op that recognizes `TensorArray`, `Operation`, and `Tensor`.

(x)

Source from the content-addressed store, hash-verified

52
53
54def _identity(x):
55 """Identity op that recognizes `TensorArray`, `Operation`, and `Tensor`."""
56 if isinstance(x, tensor_array_ops.TensorArray):
57 return x.identity()
58 elif isinstance(x, ops.Operation):
59 return control_flow_ops.group(x)
60 elif context.executing_eagerly() and x is None:
61 return None
62 else:
63 return array_ops.identity(x)
64
65
66def _get_colocation(op):

Callers 1

executeMethod · 0.85

Calls 3

executing_eagerlyMethod · 0.80
identityMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected