code: def __call__(
      self,
      pretrained=True,
      pretrained_from_file=None,
      state_dict_key_map_fn=None,
      **kwargs,
  ):
      assert not (pretrained and (pretrained_from_file is not None))
      params = replace(self.model.params, **kwargs)
  
      model = self.model.constructor(
          arch=self.model.arch, **asdict(params)
      )
  
      state_dict = None
      if pretrained:
          assert self.model.checkpoint_url is not None
          state_dict = torch.hub.load_state_dict_from_url(
              self.model.checkpoint_url,
              map_location=torch.device("cpu"),
              progress=True,
          )
  
      if pretrained_from_file is not None:
          if os.path.isfile(pretrained_from_file):
              print(
                  "=> loading pretrained weights from '{}'".format(
                      pretrained_from_file
                  )
              )
              state_dict = torch.load(
                  pretrained_from_file, map_location=torch.device("cpu")
              )
          else:
              print(
                  "=> no pretrained weights found at '{}'".format(
                      pretrained_from_file
                  )
              )
  
      if state_dict is not None:
          state_dict = {
              k[len("module.") :] if k.startswith("module.") else k: v
              for k, v in state_dict.items()
          }
  
          def reshape(t, conv):
              if conv:
                  if len(t.shape) == 4:
                      return t
                  else:
                      return t.view(t.shape[0], -1, 1, 1)
              else:
                  if len(t.shape) == 4:
                      return t.view(t.shape[0], t.shape[1])
                  else:
                      return t
  
          if state_dict_key_map_fn is not None:
              state_dict = {
                  state_dict_key_map_fn(k): v
                  for k, v in state_dict.items()
              }
  
          if pretrained and hasattr(model, "ngc_checkpoint_remap"):
              remap_fn = model.ngc_checkpoint_remap(
                  url=self.model.checkpoint_url
              )
              state_dict = {
                  remap_fn(k): v for k, v in state_dict.items()
              }
  
          def _se_layer_uses_conv(m):
              return any(
                  map(
                      partial(isinstance, m),
                      [
                          SqueezeAndExcitationTRT,
                          SequentialSqueezeAndExcitationTRT,
                      ],
                  )
              )
  
          state_dict = {
              k: reshape(
                  v,
                  conv=_se_layer_uses_conv(
                      dict(model.named_modules())[
                          ".".join(k.split(".")[:-2])
                      ]
                  ),
              )
              if is_se_weight(k, v)
              else v
              for k, v in state_dict.items()
          }
  
          model.load_state_dict(state_dict)
      return model
  
file_path: DALI/docs/examples/use_cases/pytorch/efficientnet/image_classification/models/model.py
imports: from dataclasses import dataclass, asdict, replace
  from .common import SequentialSqueezeAndExcitationTRT, SequentialSqueezeAndExcitation, SqueezeAndExcitation, SqueezeAndExcitationTRT
  from typing import Optional, Callable
  import os
  import torch
  import argparse
  from functools import partial
label_desc: Use image node_id 3 for calling the EntryPoint obj's underlying member method code with example usage: obj.__call__(pretrained, pretrained_from_file, state_dict_key_map_fn) and returns: model, any, t, t, t, t