MCPcopy Create free account
hub / github.com/PythonOT/POT / qr

Method qr

ot/backend.py:1450–1468  ·  view source on GitHub ↗
(self, a)

Source from the content-addressed store, hash-verified

1448 return self.sort(a, axis), self.argsort(a, axis)
1449
1450 def qr(self, a):
1451 np_version = tuple([int(k) for k in np.__version__.split(".")])
1452 if np_version < (1, 22, 0):
1453 M, N = a.shape[-2], a.shape[-1]
1454 K = min(M, N)
1455
1456 if len(a.shape) >= 3:
1457 n = a.shape[0]
1458
1459 qs, rs = np.zeros((n, M, K)), np.zeros((n, K, N))
1460
1461 for i in range(a.shape[0]):
1462 qs[i], rs[i] = np.linalg.qr(a[i])
1463
1464 else:
1465 return np.linalg.qr(a)
1466
1467 return qs, rs
1468 return np.linalg.qr(a)
1469
1470 def atan2(self, a, b):
1471 return np.arctan2(a, b)

Callers 1

get_projections_sphereFunction · 0.95

Calls 2

zerosMethod · 0.45
qrMethod · 0.45

Tested by

no test coverage detected