-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: First Batch of Translators #20
feat: First Batch of Translators #20
Conversation
I just copied them and did not do a merge, which is not so nice. Furthermore, the tests are not yet there, in my view it makes sense to first have something that can be checked.
Before it was implementewd as a switch, for the case JAX would use the bool overload of XLA. The check for this was now essentially moved inside the function.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
=======================================
Coverage ? 69.23%
=======================================
Files ? 31
Lines ? 1235
Branches ? 251
=======================================
Hits ? 855
Misses ? 314
Partials ? 66 ☔ View full report in Codecov by Sentry. |
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.
It looks good. Just some code style comments.
src/jace/translator/primitive_translators/select_n_translator.py
Outdated
Show resolved
Hide resolved
src/jace/translator/primitive_translators/broadcast_in_dim_translator.py
Outdated
Show resolved
Hide resolved
It is now better confiugured.
Now let's test if it works.
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.
LGTM. I only found a couple of typos and small optional suggestions, so I don't need another review round.
|
||
else: | ||
dims_to_bcast = [ | ||
dim for dim in range(out_rank) if in_shape[dim] == 1 and out_shape[dim] != 1 |
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.
Optional suggestion:
dim for dim in range(out_rank) if in_shape[dim] == 1 and out_shape[dim] != 1 | |
dim for dim in range(out_rank) if in_shape[dim] == 1 != out_shape[dim] |
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 did not know that this is possible, however, I do not think that it is very readable the a < x < b
is useful but here I do not like it that much,
src/jace/translator/primitive_translators/convert_element_type_translator.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Enrique González Paredes <enriqueg@cscs.ch>
This PR introduces a series of primitive translators, most of them are based on the prototype, with some improvements.
I just copied them over from the development branch, which is not so nice, but was the simplest thing to to without also introducing the other stuff.
It is important that the tests from the development branch were not added, to keep the PR small.
Furthermore, we need something to test, so this PR must go first.
For organizational reasons, the development history of this PR happened to be contained in PR#21.