Extract the shapes of a set of input tensors.
(inputs)
| 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: |
no test coverage detected