docstr: Initializes the model parameters and creates the model trainer.
  NOTEL Session for mxnet backend must be None.
  :param sess: must be None
docstr_tok: ["Initializes","the","model","parameters","and","creates","the","model","trainer",".","NOTEL","Session","for","mxnet","backend","must","be","None",".",":","param","sess",":","must","be","None"]
code: def set_session(self, sess) -> None:
      """
      Initializes the model parameters and creates the model trainer.
      NOTEL Session for mxnet backend must be None.
      :param sess: must be None
      """
      assert sess is None
      # FIXME Add initializer
      self.model.collect_params().initialize(ctx=self._devices)
      # Hybridize model and losses
      self.model.hybridize()
      for l in self.losses:
          l.hybridize()
  
      # Pass dummy data with correct shape to trigger shape inference and full parameter initialization
      self.model(*self._dummy_model_inputs())
  
      if self.network_is_trainable:
          self.trainer = gluon.Trainer(
              self.model.collect_params(),
              optimizer=self.optimizer,
              update_on_kvstore=False,
          )
  
imports: import copy
  from typing import Any, Dict, Generator, List, Tuple, Union
  import numpy
  import mxnet
  from mxnet import autograd, gluon, nd
  from mxnet.ndarray import NDArray
  from rl_coach.architectures.architecture import Architecture
  from rl_coach.architectures.mxnet_components.heads.head import LOSS_OUT_TYPE_LOSS, LOSS_OUT_TYPE_REGULARIZATION
  from rl_coach.architectures.mxnet_components import utils
  from rl_coach.architectures.mxnet_components.savers import ParameterDictSaver, OnnxSaver
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.logger import screen
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition
  from rl_coach.utils import force_list, squeeze_list
label_desc: Use image node_id 8 for calling the MxnetArchitecture obj's underlying member method code with example usage: obj.set_session(sess) without return types