Skip to content
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

Added: abs: tensorflow_frontend #10686

Merged
merged 6 commits into from
Feb 23, 2023
Merged

Added: abs: tensorflow_frontend #10686

merged 6 commits into from
Feb 23, 2023

Conversation

Pratit23
Copy link
Contributor

@Pratit23 Pratit23 commented Feb 20, 2023

Close #10680

Added abs in math.py with following tasks:

  • test for abs in test_math.py
  • function for abs

@ivy-leaves ivy-leaves added the TensorFlow Frontend Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist label Feb 20, 2023
Copy link
Contributor

@fspyridakos fspyridakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Just the few comments, there are some lint errors, can you please follow the guide for adding a pre-commit hook which can fix them for you.

Comment on lines 427 to 430
@to_ivy_arrays_and_back
def nextafter(x1, x2, name=None):
return ivy.nextafter(x1, x2)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the duplicate nextafter

on_device=on_device,
rtol=1e-02,
x=x[0],
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end new line at EOF

@handle_frontend_test(
fn_tree="tensorflow.math.abs",
dtype_and_x=helpers.dtype_and_values(
available_dtypes=helpers.get_dtypes("float"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this "numeric"

@Pratit23
Copy link
Contributor Author

Made the required changes

@Pratit23 Pratit23 requested a review from fspyridakos February 21, 2023 17:33
Copy link
Contributor

@fspyridakos fspyridakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, just one last thing and you're golden

@@ -425,6 +425,10 @@ def nextafter(x1, x2, name=None):
return ivy.nextafter(x1, x2)


def abs(x, name=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the unit dtypes as unsupported dtypes.

@Pratit23
Copy link
Contributor Author

Added unsupported dtypes as requested

@Pratit23 Pratit23 requested a review from fspyridakos February 22, 2023 16:29
Copy link
Contributor

@fspyridakos fspyridakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still have some unsupported dtypes to add, also please commit using the pre-commit hook as described here: https://lets-unify.ai/ivy/contributing/setting_up.html#pre-commit
This is to avoid formatting errors

Comment on lines 428 to 431
@with_unsupported_dtypes(
{"1.2.0": ("float16", "complex64", "complex128"), "1.8.0 and below": ("float16")},
"tensorflow",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the uints as unsupported from 2.9.0 and below in order to pass the test (i.e. uint8, uint16, ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was passed through the pre-commit hook

@Pratit23
Copy link
Contributor Author

Passed the latest commit through the pre-commit hook and added the missing dtypes

@Pratit23 Pratit23 requested a review from fspyridakos February 23, 2023 05:02
@fspyridakos
Copy link
Contributor

LGTM, thanks for your contribution again!

@fspyridakos fspyridakos merged commit a61fcec into ivy-llc:master Feb 23, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this pull request Feb 26, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TensorFlow Frontend Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

abs
3 participants