Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions paconvert/api_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -10833,16 +10833,7 @@
}
},
"torch.poisson": {
"Matcher": "GenericMatcher",
"paddle_api": "paddle.poisson",
"min_input_args": 1,
"args_list": [
"input",
"generator"
],
"kwargs_change": {
"input": "x"
}
"Matcher": "ChangePrefixMatcher"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

torch.poisson在其他PR已修改,本PR关闭。

},
"torch.poisson_nll_loss": {},
"torch.polar": {
Expand Down
24 changes: 24 additions & 0 deletions tests/test_poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,27 @@ def test_case_7():
"""
)
obj.run(pytorch_code, ["result"], check_value=False)


def test_case_8():
pytorch_code = textwrap.dedent(
"""
import torch
rates = torch.linspace(0.5, 4.5, 5, dtype=torch.float64)
result = torch.poisson(rates)
"""
)
obj.run(pytorch_code, ["result"], check_value=False)


def test_case_9():
pytorch_code = textwrap.dedent(
"""
import torch
rates = torch.rand(2, 3) * 10
gen = torch.Generator()
args = (rates, gen)
result = torch.poisson(*args)
"""
)
obj.run(pytorch_code, ["result"], check_value=False)