code: def alexnet(
      *,
      weights: Optional[AlexNet_Weights] = None,
      progress: bool = True,
      **kwargs: Any,
  ) -> AlexNet:
      """AlexNet model architecture from `One weird trick for parallelizing convolutional neural networks <https://arxiv.org/abs/1404.5997>`__.
  
      .. note::
          AlexNet was originally introduced in the `ImageNet Classification with
          Deep Convolutional Neural Networks
          <https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html>`__
          paper. Our implementation is based instead on the "One weird trick"
          paper above.
  
      Args:
          weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The
              pretrained weights to use. See
              :class:`~torchvision.models.AlexNet_Weights` below for
              more details, and possible values. By default, no pre-trained
              weights are used.
          progress (bool, optional): If True, displays a progress bar of the
              download to stderr. Default is True.
          **kwargs: parameters passed to the ``torchvision.models.squeezenet.AlexNet``
              base class. Please refer to the `source code
              <https://github.com/pytorch/vision/blob/main/torchvision/models/alexnet.py>`_
              for more details about this class.
  
      .. autoclass:: torchvision.models.AlexNet_Weights
          :members:
      """
  
      weights = AlexNet_Weights.verify(weights)
  
      if weights is not None:
          _ovewrite_named_param(
              kwargs, "num_classes", len(weights.meta["categories"])
          )
  
      model = AlexNet(**kwargs)
  
      if weights is not None:
          model.load_state_dict(
              weights.get_state_dict(progress=progress, check_hash=True)
          )
  
      return model
  
file_path: vision/torchvision/models/alexnet.py
imports: from functools import partial
  from typing import Any, Optional
  import torch
  import torch.nn
  from ..transforms._presets import ImageClassification
  from ..utils import _log_api_usage_once
  from ._api import register_model, Weights, WeightsEnum
  from ._meta import _IMAGENET_CATEGORIES
  from ._utils import _ovewrite_named_param, handle_legacy_interface
label_desc: Use image node_id 1 for calling a global function with example usage: alexnet() and returns: model