-
Notifications
You must be signed in to change notification settings - Fork 116
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
[WIP] Implements map_coordinates op in keras-core #784
Conversation
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.
Thanks for the PR!
if len(coordinates) != input_arr.ndim: | ||
raise ValueError( | ||
"coordinates must be a sequence of length input.ndim, but " | ||
"{} != {}".format(len(coordinates), input_arr.ndim) |
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.
Always use f-strings rather than .format()
|
||
@keras_core_export("keras_core.ops.image.map_coordinates") | ||
def map_coordinates( | ||
input, coordinates, order, mode="constant", cval=0.0 |
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.
The argument names should be consistent with the APIs we already have (like affine_transform
), e.g. cval
should be something like fill_value
): | ||
"""Applies the image(s) onto a set of coordinates. | ||
|
||
Args: |
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.
Update the docstring
(1, "reflect"), | ||
] | ||
) | ||
def test_map_coordinates01(self, order, mode): |
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.
We likely need some more test coverage
Considering the PR is abandoned -- will set this as an "request for contributions" item. |
Adds the map_coordinates op as described in #477 .