class_docstr: MNASNet, as described in https://arxiv.org/abs/1807.11626. This
  implements the B1 variant of the model.
  >>> model = MNASNet(1.0, num_classes=1000)
  >>> x = torch.rand(1, 3, 224, 224)
  >>> y = model(x)
  >>> y.dim()
  2
  >>> y.nelement()
  1000
code: def _load_from_state_dict(
      self,
      state_dict: Dict,
      prefix: str,
      local_metadata: Dict,
      strict: bool,
      missing_keys: List[str],
      unexpected_keys: List[str],
      error_msgs: List[str],
  ) -> None:
      version = local_metadata.get("version", None)
      if version not in [1, 2]:
          raise ValueError(
              f"version shluld be set to 1 or 2 instead of {version}"
          )
  
      if version == 1 and not self.alpha == 1.0:
          # In the initial version of the model (v1), stem was fixed-size.
          # All other layer configurations were the same. This will patch
          # the model so that it's identical to v1. Model with alpha 1.0 is
          # unaffected.
          depths = _get_depths(self.alpha)
          v1_stem = [
              nn.Conv2d(3, 32, 3, padding=1, stride=2, bias=False),
              nn.BatchNorm2d(32, momentum=_BN_MOMENTUM),
              nn.ReLU(inplace=True),
              nn.Conv2d(
                  32, 32, 3, padding=1, stride=1, groups=32, bias=False
              ),
              nn.BatchNorm2d(32, momentum=_BN_MOMENTUM),
              nn.ReLU(inplace=True),
              nn.Conv2d(32, 16, 1, padding=0, stride=1, bias=False),
              nn.BatchNorm2d(16, momentum=_BN_MOMENTUM),
              _stack(16, depths[2], 3, 2, 3, 3, _BN_MOMENTUM),
          ]
          for idx, layer in enumerate(v1_stem):
              self.layers[idx] = layer
  
          # The model is now identical to v1, and must be saved as such.
          self._version = 1
          warnings.warn(
              "A new version of MNASNet model has been implemented. "
              "Your checkpoint was saved using the previous version. "
              "This checkpoint will load and work as before, but "
              "you may want to upgrade by training a newer model or "
              "transfer learning from an updated ImageNet checkpoint.",
              UserWarning,
          )
  
      super()._load_from_state_dict(
          state_dict,
          prefix,
          local_metadata,
          strict,
          missing_keys,
          unexpected_keys,
          error_msgs,
      )
  
imports: import warnings
  from functools import partial
  from typing import Any, Dict, List, Optional
  import torch
  import torch.nn
  from torch import Tensor
  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 3 for calling the MNASNet obj's underlying member method code with example usage: obj._load_from_state_dict(state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs) without return types