The greatest lower bound (ordered by specificity) TensorShape.
(s1, s2)
| 101 | |
| 102 | |
| 103 | def _shape_common(s1, s2): |
| 104 | """The greatest lower bound (ordered by specificity) TensorShape.""" |
| 105 | s1 = tensor_shape.TensorShape(s1) |
| 106 | s2 = tensor_shape.TensorShape(s2) |
| 107 | if s1.ndims is None or s2.ndims is None or s1.ndims != s2.ndims: |
| 108 | return tensor_shape.unknown_shape() |
| 109 | d = [ |
| 110 | d1 if d1 is not None and d1 == d2 else None |
| 111 | for (d1, d2) in zip(s1.as_list(), s2.as_list()) |
| 112 | ] |
| 113 | return tensor_shape.TensorShape(d) |
| 114 | |
| 115 | |
| 116 | # pylint: disable=protected-access |
nothing calls this directly
no test coverage detected