No it does not work. Yesterday I went through the pytorch github to understand the dependencies and Optional comes from
from typing import Tuple, List, Dict, Optional, Union, Any, TypeVar, Generic
If I import Optional without
from torch.jit.annotations import Optional

but with
from typing import Optional

This is working but then I have the error because of the following line in the inceptionv3 model

  
      github.com
  
  
    pytorch/vision/blob/8c9585540a3e71f73ebc281445e888aa841824bd/torchvision/models/inception.py#L185 1

    x = F.adaptive_avg_pool2d(x, (1, 1))
    # N x 2048 x 1 x 1
    x = F.dropout(x, training=self.training)
    # N x 2048 x 1 x 1
    x = torch.flatten(x, 1)
    # N x 2048
    x = self.fc(x)
    # N x 1000 (num_classes)
    return x, aux


@torch.jit.unused
def eager_outputs(self, x, aux):
    # type: (Tensor, Optional[Tensor]) -> InceptionOutputs
    if self.training and self.aux_logits:
        return InceptionOutputs(x, aux)
    else:
        return x


def forward(self, x):
    x = self._transform_input(x)
    x, aux = self._forward(x)