code: def _set_trainer(self, trainer):
          
          # trainer cannot be replaced for sparse params
          if self._stype != 'default' and self._trainer and trainer and self._trainer is not trainer:
              raise RuntimeError(
                  "Failed to set the trainer for Parameter '%s' because it was already set. " \
                  "More than one trainers for a %s Parameter is not supported." \
                  %(self.name, self._stype))
          self._trainer = trainer
docs: Set the trainer this parameter is associated with.