def convert_to_network_wb(
    x: "torch.Tensor", net_size: tuple[int, int], clip_min: float, clip_max: float
) -> "torch.Tensor":
    """
    Convert image to network format.

    :param x: Input image.
    :param net_size: Size of the image for the network.
    :param clip_min: Minimum value of an example.
    :param clip_max: Maximum value of an example.
    :return: Transformed image.
    """
    import torch
    from kornia.geometry.transform import resize

    orig_device = x.device
    x = resize(x, (net_size[1], net_size[0]), align_corners=False)
    x = torch.clamp(x, 0.0, 1.0)
    x = x * (clip_max - clip_min) + clip_min
    return x.to(orig_device)

    Convert image to network format.

    :param x: Input image.
    :param net_size: Size of the image for the network.
    :param clip_min: Minimum value of an example.
    :param clip_max: Maximum value of an example.
    :return: Transformed image.
    
art/attacks/evasion/graphite/utils.py