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

Function _ExtractInputShapes

tensorflow/python/ops/array_grad.py:85–102  ·  view source on GitHub ↗

Extract the shapes of a set of input tensors.

(inputs)

Source from the content-addressed store, hash-verified

83 return mask, begin
84
85 def _ExtractInputShapes(inputs):
86 """Extract the shapes of a set of input tensors."""
87 if context.executing_eagerly():
88 return array_ops.shape_n(inputs)
89 sizes = []
90 fully_known = True
91 for x in inputs:
92 input_shape = array_ops.shape(x)
93 if not isinstance(input_shape,
94 ops.Tensor) or input_shape.op.type != "Const":
95 fully_known = False
96 break
97 sizes.append(input_shape)
98
99 if fully_known:
100 return sizes
101 else:
102 return array_ops.shape_n(inputs)
103
104 # Degenerate concatenation, just return grad.
105 if len(op.inputs) == 2:

Callers 1

_ConcatGradHelperFunction · 0.85

Calls 3

executing_eagerlyMethod · 0.80
shapeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected