micropython-ulab
micropython-ulab copied to clipboard
SVD unittests
Getting an odd bug on one of my unittests where one of the prints causes them to crash.
https://github.com/EmDash00/micropython-ulab/blob/5587d4e69dd7e635d5e6223aabc7019057631d2d/tests/2d/scipy/svd.py#L94
A = rng.random((15, 10))
U, S, Vh = sp.linalg.svd(A)
# print(np.dot(U * S, Vh))
B = np.dot(np.dot(U, S), Vh)
print("15x10 Random Compare:", np.max(abs(A - B)) < tol)
print()
I'm not sure why it doesn't like the print line. All the other prints in the unittest seem fine.
Either way most of the them appear to fail. Not sure why. It's likely some bug in the internal implementation. I'm currently assuming the S matrix output is 2D; however, it would be good to make it 1D. I have adjusted test cases for those already written, but they're commented out.
OK, thanks, I'll take a look.