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

fixed tensorflow.math.softplus #28466

Merged
merged 5 commits into from
Mar 26, 2024
Merged

fixed tensorflow.math.softplus #28466

merged 5 commits into from
Mar 26, 2024

Conversation

ZJay07
Copy link
Contributor

@ZJay07 ZJay07 commented Mar 1, 2024

PR Description

image

Related Issue

Close #28465

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference

In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our contributing guide and our PR template.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

Conventional Commit PR Title

In order to be considered for merging, the pull request title must match the specification in conventional commits. You can edit the title in order for this check to pass.
Most often, our PR titles are something like one of these:

  • docs: correct typo in README
  • feat: implement dark mode"
  • fix: correct remove button behavior

Linting Errors

  • Found type "null", must be one of "feat","fix","docs","style","refactor","perf","test","build","ci","chore","revert"
  • No subject found

@ivy-leaves ivy-leaves added the TensorFlow Frontend Developing the TensorFlow Frontend, checklist triggered by commenting add_frontend_checklist label Mar 1, 2024
Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

Hi @ZJay07
Thank you very much for the PR
I think there are other dtypes that the native tf does support like tf.float16
as maybe checked with

import tensorflow as tf
x = tf.constant([0.5], dtype=tf.float16)
tf.math.softplus(x)

does the test not pass for dtypes other float32 and float64?

@ZJay07
Copy link
Contributor Author

ZJay07 commented Mar 11, 2024

Hey @Ishticode, I tried rerunning the test again adding float16 and got this error, does this means tf.math.softplus does not support float16?

ivy.utils.exceptions.IvyBackendException: paddle: softplus: paddle: abs: (NotFound) The kernel with key (CPU, Undefined(AnyLayout), float16) of kernel `abs` is not registered. Selected wrong DataType `float16`. Paddle support following DataTypes: int32, int64, float64, complex128, float32, complex64.

@ZJay07 ZJay07 requested a review from Ishticode March 14, 2024 21:38
Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

This error means the paddle backend is unable to run this function with float16. You will need to specify float16 as unsupported for ivy's softplus function paddle backend. Does that make sense?

@ZJay07
Copy link
Contributor Author

ZJay07 commented Mar 17, 2024

Just fixed it and including float16, is this the right way to do it?

@ZJay07 ZJay07 requested a review from Ishticode March 21, 2024 19:41
@@ -2858,6 +2858,8 @@ def test_tensorflow_softplus(
on_device,
):
input_dtype, x = dtype_and_x
if backend_fw == "paddle" and "float16" in input_dtype:
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be specified as unsupported in paddle backends softplus implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, forgot to update this, will fix it right away!

@ZJay07 ZJay07 requested a review from Ishticode March 25, 2024 18:16
Copy link
Contributor

@Ishticode Ishticode left a comment

Choose a reason for hiding this comment

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

Thank you. Looks good to merge :)

@Ishticode Ishticode merged commit 9d65596 into ivy-llc:main Mar 26, 2024
136 of 141 checks passed
@ZJay07 ZJay07 deleted the fixing_test branch March 26, 2024 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paddle Paddle Backend 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.

Fix Frontend Failing Test: paddle - math.tensorflow.math.softplus
3 participants