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

fixed: Bugs1 #22037

Closed
wants to merge 6 commits into from
Closed
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
34 changes: 33 additions & 1 deletion ivy/functional/backends/paddle/experimental/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,39 @@ def interpolate(
antialias: Optional[bool] = False,
out: Optional[paddle.Tensor] = None,
):
raise IvyNotImplementedException()
if mode == "linear":
interpolation_method = "linear"
elif mode == "bilinear":
interpolation_method = "bilinear"
elif mode == "trilinear":
interpolation_method = "trilinear"
else:
raise ValueError("Invalid interpolation mode")

if scale_factor is not None:
if isinstance(scale_factor, int):
scale_factor = (scale_factor,) * len(size)
elif isinstance(scale_factor, tuple):
scale_factor = scale_factor
else:
raise ValueError("Invalid scale_factor type")

if recompute_scale_factor is not None:
raise ValueError("recompute_scale_factor is not supported in paddle backend")

if align_corners is None:
align_corners = False

if antialias is not None:
raise ValueError("antialias is not supported in paddle backend")

return paddle.nn.functional.interpolate(
x,
size,
mode=interpolation_method,
align_corners=align_corners,
scale_factor=scale_factor,
)


def adaptive_max_pool2d(
Expand Down
Loading