(lhs_shape, rhs_shape)
| 43 | |
| 44 | |
| 45 | def _shape_equal(lhs_shape, rhs_shape): |
| 46 | lhs_shape = lhs_shape.tolist() if isinstance(lhs_shape, np.ndarray) else lhs_shape |
| 47 | rhs_shape = rhs_shape.tolist() if isinstance(rhs_shape, np.ndarray) else rhs_shape |
| 48 | assert isinstance(lhs_shape, (tuple, list)) and isinstance( |
| 49 | rhs_shape, (tuple, list) |
| 50 | ), f"lhs_shape: {lhs_shape}{type(lhs_shape)}, rhs_shape: {rhs_shape}{type(rhs_shape)}" |
| 51 | if len(lhs_shape) == 0 and len(rhs_shape) == 0: |
| 52 | return True |
| 53 | if len(lhs_shape) != 0: |
| 54 | assert isinstance(lhs_shape[0], (int, np.int32)), f"{lhs_shape}, {rhs_shape}" |
| 55 | if len(rhs_shape) != 0: |
| 56 | assert isinstance(rhs_shape[0], (int, np.int32)), f"{lhs_shape}, {rhs_shape}" |
| 57 | |
| 58 | if len(lhs_shape) != len(rhs_shape): |
| 59 | return False |
| 60 | |
| 61 | for l, r in zip(lhs_shape, rhs_shape): |
| 62 | if l != r: |
| 63 | return False |
| 64 | |
| 65 | return True |
| 66 | |
| 67 | |
| 68 | def _check_shape(actual, ref): |
no test coverage detected