class_docstr: Inception Model pre-trained on the ImageNet Dataset.
  
  Args:
      return_features: set it to `True` if you want the model to return features from the last pooling
          layer instead of prediction probabilities.
      device: specifies which device updates are accumulated on. Setting the
          metric's device to be the same as your ``update`` arguments ensures the ``update`` method is
          non-blocking. By default, CPU.
class_docstr_tok: ["Inception","Model","pre-trained","on","the","ImageNet","Dataset",".","Args",":","return_features",":","set","it","to","`","True","`","if","you","want","the","model","to","return","features","from","the","last","pooling","layer","instead","of","prediction","probabilities",".","device",":","specifies","which","device","updates","are","accumulated","on",".","Setting","the","metric","'s","device","to","be","the","same","as","your","``","update","``","arguments","ensures","the","``","update","``","method","is","non-blocking",".","By","default",",","CPU","."]
code: def __init__(
      self,
      return_features: bool,
      device: Union[str, torch.device] = "cpu",
  ) -> None:
      try:
          import torchvision
          from torchvision import models
      except ImportError:
          raise ModuleNotFoundError(
              "This module requires torchvision to be installed."
          )
      super(InceptionModel, self).__init__()
      self._device = device
      if Version(torchvision.__version__) < Version("0.13.0"):
          model_kwargs = {"pretrained": True}
      else:
          model_kwargs = {
              "weights": models.Inception_V3_Weights.DEFAULT
          }
  
      self.model = models.inception_v3(**model_kwargs).to(self._device)
  
      if return_features:
          self.model.fc = torch.nn.Identity()
      else:
          self.model.fc = torch.nn.Sequential(
              self.model.fc, torch.nn.Softmax(dim=1)
          )
      self.model.eval()
  
file_path: ignite/ignite/metrics/gan/utils.py
imports: from typing import Callable, Optional, Union
  import torch
  from packaging.version import Version
  from ignite.metrics.metric import Metric
label_desc: Use image node_id 1 to create a new InceptionModel object from inherited base classes: torch.nn with example: obj = InceptionModel(return_features, device)