-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
feat: added bernoulli_ #23680
Closed
Closed
feat: added bernoulli_ #23680
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
43dce0a
Update tensor.py
jaskiratsingh2000 ee499f0
Merge branch 'unifyai:main' into patch-4
jaskiratsingh2000 91abf98
Update test_tensor.py
jaskiratsingh2000 cc324f1
Update test_tensor.py
jaskiratsingh2000 e1e2de1
Update test_tensor.py
jaskiratsingh2000 416a50a
Update test_tensor.py
jaskiratsingh2000 f33bb56
Update test_tensor.py
jaskiratsingh2000 dcfbace
Update test_tensor.py
jaskiratsingh2000 c3ac319
Update test_tensor.py
jaskiratsingh2000 ed5089f
Update test_tensor.py
jaskiratsingh2000 df43e41
Update test_tensor.py (on device argument added)
jaskiratsingh2000 372d799
Update test_tensor.py (back to original)
jaskiratsingh2000 6a195a0
Update test_tensor.py (original)
jaskiratsingh2000 3e37555
Update test_tensor.py
jaskiratsingh2000 8f6128a
Update test_tensor.py
jaskiratsingh2000 cf869c6
Update test_tensor.py
jaskiratsingh2000 934bd19
Update test_tensor.py
jaskiratsingh2000 4febc26
Update test_tensor.py
jaskiratsingh2000 16e2ca9
Merge remote-tracking branch 'upstream/main' into pr/23680
NripeshN 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
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 |
---|---|---|
|
@@ -4235,6 +4235,40 @@ def test_torch_tensor_bernoulli( | |
) | ||
|
||
|
||
# bernoulli_ | ||
@handle_frontend_method( | ||
class_tree=CLASS_TREE, | ||
init_tree="torch.tensor", | ||
method_name="bernoulli_", | ||
dtype_and_x=helpers.dtype_and_values( | ||
available_dtypes=helpers.get_dtypes("valid"), | ||
), | ||
test_with_out=st.just(True), | ||
) | ||
def test_torch_tensor_bernoulli_( | ||
dtype_and_x, | ||
frontend, | ||
frontend_method_data, | ||
init_flags, | ||
method_flags, | ||
backend_fw, | ||
): | ||
input_dtype, x = dtype_and_x | ||
helpers.test_frontend_method( | ||
init_input_dtypes=input_dtype, | ||
backend_to_test=backend_fw, | ||
init_all_as_kwargs_np={ | ||
"input": x[0], | ||
}, | ||
method_input_dtypes=input_dtype, | ||
method_all_as_kwargs_np={"generator": x[1], "out": x[2]}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
frontend_method_data=frontend_method_data, | ||
init_flags=init_flags, | ||
method_flags=method_flags, | ||
frontend=frontend, | ||
) | ||
|
||
|
||
# bitwise_and | ||
@handle_frontend_method( | ||
class_tree=CLASS_TREE, | ||
|
Oops, something went wrong.
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.
Remove this line
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.
Let me know if that works
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.
@umairjavaid you mean removing "test_with_out=st.just(True)" line right?
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.
@jaskiratsingh2000 Yup we'll have to remove this