-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Fixed support for scalars for both the backend and cometPy
2. Updated cometpy to use latest version of SciPy and added it as a strict dependency.
- Loading branch information
1 parent
ecdb46c
commit cfd9a7a
Showing
10 changed files
with
188 additions
and
38 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
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,30 @@ | ||
import time | ||
import numpy as np | ||
import scipy as sp | ||
from cometpy import comet | ||
|
||
def run_numpy(): | ||
a = 5 + 1 | ||
b = a + 5 + 1 | ||
c = b / 2 | ||
d = c * 3 | ||
e = d - 1 | ||
|
||
return e | ||
|
||
@comet.compile(flags=None) | ||
def run_comet_with_jit(): | ||
a = 5 + 1 | ||
b = a + 5 + 1 | ||
c = b / 2 | ||
d = c * 3 | ||
e = d - 1 | ||
|
||
return e | ||
|
||
expected_result = run_numpy() | ||
result_with_jit = run_comet_with_jit() | ||
if sp.sparse.issparse(expected_result): | ||
expected_result = expected_result.todense() | ||
result_with_jit = result_with_jit.todense() | ||
np.testing.assert_almost_equal(result_with_jit, expected_result) |
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 |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
install_requires=[ | ||
'jinja2', | ||
'numpy', | ||
'scipy>=1.10' | ||
'scipy>=1.14' | ||
], | ||
python_requires=">=3.8", | ||
) |
Oops, something went wrong.