-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
interpolate function #19491
Conversation
mode=mode, | ||
align_corners=align_corners, | ||
) | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@sladyn98 Do you require any more changes? If not then can you please merge my PR. Thank you. |
@ausafchaps The tests seem to be failing, could you check the reason |
@sladyn98 None of the failing tests are related to my function. |
close #19489