File: quick_check_numpy.py

package info (click to toggle)
python-auditwheel 6.6.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: python: 6,165; ansic: 304; cpp: 66; sh: 28; makefile: 25; f90: 12
file content (14 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Sample numpy program that requires some BLAS and LAPACK routines to work
# properly
from __future__ import annotations

import numpy as np

rng = np.random.RandomState(0)
X = rng.randn(500, 200)
XTX = np.dot(X.T, X)
U, S, VT = np.linalg.svd(XTX)
if all(S > 0):
    print("ok")
else:
    print("[ERROR] invalid singular values:", S)