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: interpolate #22034

Closed
wants to merge 3 commits into from
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
27 changes: 26 additions & 1 deletion ivy/functional/backends/paddle/experimental/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,34 @@ def interpolate(
recompute_scale_factor: Optional[bool] = None,
align_corners: Optional[bool] = None,
antialias: Optional[bool] = False,
data_format: Optional[str] = "NCHW",
out: Optional[paddle.Tensor] = None,
):
raise IvyNotImplementedException()
if mode == "linear":
interpolation_method = paddle.nn.functional.interpolate.LINEAR
elif mode == "bilinear":
interpolation_method = paddle.nn.functional.interpolate.BILINEAR
elif mode == "trilinear":
interpolation_method = paddle.nn.functional.interpolate.TRILINEAR
else:
raise ValueError("Invalid interpolation mode")

if align_corners is None:
align_corners = False

interpolated_tensor = paddle.nn.functional.interpolate(
x=x,
size=size,
scale_factor=scale_factor,
# recompute_scale_factor=recompute_scale_factor,
mode=interpolation_method,
align_corners=align_corners,
# antialias=antialias,
data_format=data_format,
out=out,
)

return interpolated_tensor


def adaptive_max_pool2d(
Expand Down
2 changes: 1 addition & 1 deletion ivy/functional/backends/paddle/statistical.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ def einsum(
*operands: paddle.Tensor,
out: Optional[paddle.Tensor] = None,
) -> paddle.Tensor:
raise IvyNotImplementedException()
raise IvyNotImplementedException()
Loading