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 erf op to math.py #908

Closed
wants to merge 14 commits into from
Closed
Prev Previous commit
Next Next commit
shortened comment lines, renamed the new function
  • Loading branch information
sqali committed Sep 18, 2023
commit 79601064739edc6f110d2e590357fd4d2eaebba9
2 changes: 1 addition & 1 deletion keras_core/ops/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ class Erf(Operation):
input_tensor: A tensor of type `float32` or `float64`.
Copy link
Contributor

Choose a reason for hiding this comment

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

It can have more types, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Edited the comments based on that


Returns:
A tensor of the same shape and type as `input_tensor`, containing the error function values.
A tensor of the same shape and type as `input_tensor`.

Examples:

Expand Down
2 changes: 1 addition & 1 deletion keras_core/ops/math_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def test_rsqrt(self):
self.assertAllClose(kmath.Rsqrt()(x), 1 / np.sqrt(x))


class MathOpsCorrectnessTest(testing.TestCase, parameterized.TestCase):
class ErfFunctionTests(testing.TestCase, parameterized.TestCase):
def test_erf_operation_basic(self):
# Sample values for testing
sample_values = np.array([-3.0, -2.0, -1.0, 0.0, 1.0, 2.0, 3.0])
Expand Down