-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: working matrix inverse (not integrated)
- Loading branch information
Showing
7 changed files
with
46 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from nada_test import nada_test, NadaTest | ||
import sys | ||
import nada_numpy.client as na | ||
import numpy as np | ||
|
||
# Functional style test | ||
@nada_test(program="matrix_inverse") | ||
def my_test(): | ||
n = 10 | ||
m = np.random.rand(n, n) | ||
mx = np.sum(np.abs(m), axis=1) | ||
np.fill_diagonal(m, mx) | ||
A = na.array(m * (1 << 16), "A", nada_type=int) | ||
print("INPUTS:", A, file=sys.stderr) | ||
outputs = yield A | ||
print(outputs, file=sys.stderr) | ||
for output, value in outputs.items(): | ||
output = output.split("_") | ||
if output[-1] == output[-2]: | ||
assert value == 1, f"Expected 1 {output}, got {value}" | ||
else: | ||
assert value == 0, f"Expected 0 {output}, got {value}" | ||
|
||
#assert outputs["my_output"] == a + b |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters