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

interpolate function #19491

Merged
merged 17 commits into from
Aug 7, 2023
Merged

interpolate function #19491

merged 17 commits into from
Aug 7, 2023

Conversation

ausafchaps
Copy link
Contributor

close #19489

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Jul 16, 2023
mode=mode,
align_corners=align_corners,
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Arguments size and scale_factor: For interpolation, you generally use either size (the output size) or scale_factor (the multiplier for the spatial size). It's unusual to use both at the same time because they serve similar purposes. The function should probably handle cases where one or the other is None.

Tests for different dimensions: min_num_dims=4 and max_num_dims=4 imply that the function will only test 4D tensors. While it's common to have 4D tensors in convolutional neural networks (CNNs), testing for 3D or 5D tensors could make the test more robust, especially if you're working with different types of data or architectures.

Tests for different interpolation modes with align_corners: The test generates cases with all the interpolation modes combined with align_corners=True and align_corners=False. However, the align_corners option is not supported for all interpolation modes in some libraries. In PyTorch, for instance, it's not supported for 'nearest' or 'area'. If this is also the case for PaddlePaddle, you should adjust the test to only use align_corners with the modes that support it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • size (list|tuple|Tensor|None) – Output shape of image resize layer, the shape is (out_w, ) when input is a 3-D Tensor, the shape is (out_h, out_w) when input is a 4-D Tensor and is (out_d, out_h, out_w) when input is a 5-D Tensor. Default: None. If a list/tuple, each element can be an integer or a Tensor of shape: [1] or []. If a Tensor, its dimensions size should be a 1.

  • scale_factor (float|Tensor|list|tuple|None) – The multiplier for the input height or width. At least one of size or scale_factor must be set. And size has a higher priority than scale_factor.Has to match input size if it is either a list or a tuple or a Tensor.If a list/tuple, each element can be an integer or a Tensor of shape: [1] or []. Default: None.

Argument size and scale_factor: Both size and scale_factor are used in interpolate function of paddlepaddle.
https://www.paddlepaddle.org.cn/documentation/docs/en/api/paddle/nn/functional/interpolate_en.html#interpolate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

align_corners: I only used the ones that are supported by PaddlePaddle

@ausafchaps ausafchaps requested a review from sladyn98 July 26, 2023 13:19
@ausafchaps ausafchaps requested a review from sladyn98 July 30, 2023 16:43
@ausafchaps
Copy link
Contributor Author

ausafchaps commented Aug 2, 2023

@sladyn98 Do you require any more changes? If not then can you please merge my PR. Thank you.

@sladyn98
Copy link
Contributor

sladyn98 commented Aug 2, 2023

@ausafchaps The tests seem to be failing, could you check the reason

@ausafchaps
Copy link
Contributor Author

@ausafchaps The tests seem to be failing, could you check the reason

@sladyn98 None of the failing tests are related to my function.

@HaiderSultanArc HaiderSultanArc merged commit dc37563 into ivy-llc:master Aug 7, 2023
201 of 266 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

interpolate
4 participants