MCPcopy Create free account
hub / github.com/numpy/numpy / identity_like_generalized

Function identity_like_generalized

numpy/linalg/tests/test_linalg.py:453–460  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

451
452
453def identity_like_generalized(a):
454 a = asarray(a)
455 if a.ndim >= 3:
456 r = np.empty(a.shape, dtype=a.dtype)
457 r[...] = identity(a.shape[-2])
458 return r
459 else:
460 return identity(a.shape[0])
461
462
463class SolveCases(LinalgSquareTestCase, LinalgGeneralizedSquareTestCase):

Callers 2

doMethod · 0.85
tzMethod · 0.85

Calls 2

asarrayFunction · 0.90
identityFunction · 0.90

Tested by

no test coverage detected