MCPcopy
hub / github.com/numpy/numpy / identity_like_generalized

Function identity_like_generalized

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

Source from the content-addressed store, hash-verified

479
480
481def 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
491class 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…