New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sinh & cosh numpy_intrinsic functions implemented #1002
Conversation
@czgdp1807 could you please help me with this error? |
d671c65
to
6e3f27b
Compare
integration_tests/elemental_05.py
Outdated
for j in range(size2): | ||
for k in range(size3): | ||
for l in range(size4): | ||
assert abs( ((sinh(array[i, j, k, l])%3) +2)/2 - result[i, j, k, l]) <= eps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@certik Builtin %
in LPython doesn't work on arrays by default because it is implemented as a function and not a binop
. So the question is which approach to follow,
- To make
_mod
function defined inlpython_builtin.py
vectorised; - Define
Mod
asbinop
and then usebuilder->CreateSRem
in LLVM backend. Note that not all backends might support modulus operation on types other than integers. - Define
mod
and then make it vectorisable.
I think 3rd approach is a good one and complies with Python and NumPy standards. What do you say @certik?
4132dc8
to
7757d59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@certik This is ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good, thanks!
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
Co-authored-by: Madhav2310 <madhav.mittal.mat19@itbhu.ac.in>
7757d59
to
54e5bd0
Compare
No description provided.