-
Notifications
You must be signed in to change notification settings - Fork 91
Added padding_idx=None option and new test cases for aten_embedding_bag #2549
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
6b232d9
40f487b
294eca3
7192035
6e41cfe
d2da96e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2210,6 +2210,44 @@ def __init__(self): | |
| sample_inputs_func=sample_inputs_embedding_bag_padding_idx, | ||
| supports_out=False, | ||
| ), | ||
| opinfo_core.OpInfo( | ||
| "test_embedding_bag_with_padding_idx_none", | ||
| op=torch.nn.functional.embedding_bag, | ||
| dtypes=(torch.float32,), | ||
| sample_inputs_func=lambda op_info, device, dtype, requires_grad: [ | ||
| opinfo_core.SampleInput( | ||
| torch.tensor( | ||
| [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0], [3.0, 3.0, 3.0], [4.0, 4.0, 4.0]], | ||
| dtype=dtype, | ||
| device=device, | ||
| ), | ||
| args=( | ||
| torch.tensor([0, 1, 2, 3], dtype=torch.int64, device=device), | ||
| torch.tensor([0, 2], dtype=torch.int64, device=device), | ||
| ), | ||
| kwargs={"padding_idx": None}, | ||
| ) | ||
| ], | ||
| ), | ||
| opinfo_core.OpInfo( | ||
| "test_embedding_bag_with_padding_idx_int", | ||
crypto-a marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| op=torch.nn.functional.embedding_bag, | ||
| dtypes=(torch.float32,), | ||
|
||
| sample_inputs_func=lambda op_info, device, dtype, requires_grad: [ | ||
| opinfo_core.SampleInput( | ||
| torch.tensor( | ||
| [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0], [3.0, 3.0, 3.0]], | ||
| dtype=dtype, | ||
| device=device, | ||
| ), | ||
| args=( | ||
| torch.tensor([0, 1, 2], dtype=torch.int64, device=device), | ||
| torch.tensor([0, 2], dtype=torch.int64, device=device), | ||
| ), | ||
| kwargs={"padding_idx": 0}, | ||
| ) | ||
| ], | ||
| ), | ||
| opinfo_core.OpInfo( | ||
| "ops.aten.embedding_renorm", | ||
| aten_name="embedding_renorm", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.