def apply_coords_paddle(self,
                            coords: paddle.Tensor,
                            original_size: Tuple[int, ...]) -> paddle.Tensor:
        """
        Expects a paddle tensor with length 2 in the last dimension. Requires the
        original image size in (H, W) format.
        """
        old_h, old_w = original_size
        new_h, new_w = self.get_preprocess_shape(
            original_size[0], original_size[1], self.target_length)
        coords = deepcopy(coords).to(paddle.float)
        coords[..., 0] = coords[..., 0] * (new_w / old_w)
        coords[..., 1] = coords[..., 1] * (new_h / old_h)
        return coords

        Expects a paddle tensor with length 2 in the last dimension. Requires the
        original image size in (H, W) format.
        
contrib/SegmentAnything/segment_anything/utils/transforms.py