-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Adding Cos, Sin, Acos, Sigmoid to PyTorch Frontend #2471
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
64d3fed
Added cos and sin Pointwise ops to PyTorch Frontend
pritam1322 f5d4280
Added acos to Pointwise Ops to Pytorch Frontend
pritam1322 5623ddf
Delete test_elementwise.py
pritam1322 b77cb90
Delete pytest_for_elementwise.xml
pritam1322 e154812
Delete pytest_for_functional_core.xml
pritam1322 bba58e6
Non-linear Activation Function #sigmoid
pritam1322 dc64266
Merge remote-tracking branch 'origin/master' into master
pritam1322 5bf454c
Revert "Delete test_elementwise.py"
pritam1322 d4429c1
Revert "Delete pytest_for_elementwise.xml"
pritam1322 2522763
Revert "Delete pytest_for_functional_core.xml"
pritam1322 eaaa937
Non-linear Activation Function #sigmoid
pritam1322 cbed1ee
Deleted files
pritam1322 b3f6a20
Merge branch 'master' into master
iamjameskeane f0a0c68
Updated
pritam1322 ff73e0e
Update test_pointwise_ops.py
pritam1322 21368b0
Update test_pointwise_ops.py
pritam1322 76d6efd
Update test_pointwise_ops.py
pritam1322 e4135e3
Update test_elementwise.py
pritam1322 c0c795c
Updated sigmoid in test_non_linear_activation_functions.py
pritam1322 761a427
Updated test_non_linear_activation_functions.py
pritam1322 cc8b020
Update pointwise_ops.py
iamjameskeane aa411fd
Update pointwise_ops.py
pritam1322 48e30a2
Update pointwise_ops.py
pritam1322 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
ivy/functional/frontends/torch/non_linear_activation_functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# global | ||
import ivy | ||
|
||
|
||
def sigmoid(input, out=None): | ||
return ivy.sigmoid(input, out=out) | ||
|
||
|
||
sigmoid.unsupported_dtypes = ("float16",) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
ivy_tests/test_ivy/test_frontends/test_torch/test_non_linear_activation_functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# global | ||
import numpy as np | ||
from hypothesis import given, strategies as st | ||
|
||
# local | ||
import ivy_tests.test_ivy.helpers as helpers | ||
import ivy.functional.backends.numpy as ivy_np | ||
import ivy.functional.backends.torch as ivy_torch | ||
|
||
|
||
@given( | ||
dtype_and_x=helpers.dtype_and_values( | ||
available_dtypes=tuple( | ||
set(ivy_np.valid_float_dtypes).intersection( | ||
set(ivy_torch.valid_float_dtypes) | ||
) | ||
) | ||
), | ||
as_variable=st.booleans(), | ||
with_out=st.booleans(), | ||
num_positional_args=helpers.num_positional_args(fn_name="sigmoid"), | ||
native_array=st.booleans(), | ||
) | ||
def test_torch_sigmoid( | ||
dtype_and_x, | ||
as_variable, | ||
with_out, | ||
num_positional_args, | ||
native_array, | ||
fw, | ||
): | ||
input_dtype, x = dtype_and_x | ||
|
||
helpers.test_frontend_function( | ||
input_dtypes=input_dtype, | ||
as_variable_flags=as_variable, | ||
with_out=with_out, | ||
num_positional_args=num_positional_args, | ||
native_array_flags=native_array, | ||
fw=fw, | ||
frontend="torch", | ||
fn_name="sigmoid", | ||
input=np.asarray(x, dtype=input_dtype), | ||
out=None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
add float 16 as unsupported data type here