(a)
| 479 | |
| 480 | |
| 481 | def identity_like_generalized(a): |
| 482 | a = asarray(a) |
| 483 | if a.ndim >= 3: |
| 484 | r = np.empty(a.shape, dtype=a.dtype) |
| 485 | r[...] = identity(a.shape[-2]) |
| 486 | return r |
| 487 | else: |
| 488 | return identity(a.shape[0]) |
| 489 | |
| 490 | |
| 491 | class SolveCases(LinalgSquareTestCase, LinalgGeneralizedSquareTestCase): |