`NEAREST_EXACT` and `BICUBIC` work against the doc of `AutoAugment()`

Open
#9,073 2 comments 0 reactions 1 assignee View on GitHub

@AntoineSimoulin is already working on this.

Since May 21, 2025.

Assessment

This issue has not been assessed yet.

Description

🐛 Describe the bug

The doc of AutoAugment() says that only NEAREST and BILINEAR are supported:

Parameters:
...

  • interpolation (InterpolationMode, optional) – ... If input is Tensor, only InterpolationMode.NEAREST, InterpolationMode.BILINEAR are supported.

But NEAREST_EXACT and BICUBIC work against the doc as shown below:

from torchvision.datasets import OxfordIIITPet
from torchvision.transforms.v2 import AutoAugment, PILToTensor

origin_data = OxfordIIITPet(
    root="data"
)

def show_aaimagetensor(im, ip=None):
    aa = AutoAugment(interpolation=ip)
    ptt = PILToTensor()
    print(ptt(aa(im))[0][200])

show_aaimagetensor(im=origin_data[0][0], ip=InterpolationMode.NEAREST_EXACT)
# tensor([ 83,  74,  77,  80,  81,  76,  85,  88, 128, 143,
#         194, 215, 247, 225, 242, 255, 255, 238, 242, 242,
#         242, 247, 255, 238, 247, ..., 255, 255,   0], dtype=torch.uint8)

show_aaimagetensor(im=origin_data[0][0], ip=InterpolationMode.BICUBIC)
# tensor([ 32,  34,  34,  32,  30,  34,  36,  36,  36,  36,
#          36,  37,  28,  30,  30,  30,  34,  30,  30,  32,
#          34,  25,  30,  34,  32, ...,  34,  27,  27], dtype=torch.uint8)
Versions
import torchvision

torchvision.__version__ # '0.20.1'
Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pytorch/vision

All issues in pytorch/vision

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.