code: def create_transfo_xl_lm_head(
      self, config, input_ids_1, input_ids_2, lm_labels
  ):
      model = TransfoXLLMHeadModel(config)
      model.to(torch_device)
      model.eval()
  
      lm_logits_1 = model(input_ids_1)["prediction_scores"]
      outputs1 = model(input_ids_1, labels=lm_labels)
      lm_logits_2 = model(input_ids_2, mems=outputs1["mems"])[
          "prediction_scores"
      ]
      outputs2 = model(
          input_ids_2, labels=lm_labels, mems=outputs1["mems"]
      )
  
      outputs = {
          "loss_1": outputs1["loss"],
          "losses_1": outputs1["losses"],
          "mems_1": outputs1["mems"],
          "lm_logits_1": lm_logits_1,
          "loss_2": outputs2["loss"],
          "losses_2": outputs2["losses"],
          "mems_2": outputs2["mems"],
          "lm_logits_2": lm_logits_2,
      }
      return outputs
  
imports: import copy
  import random
  import unittest
  from transformers import TransfoXLConfig, is_torch_available
  from transformers.testing_utils import require_torch, require_torch_multi_gpu, slow, torch_device
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor
label_desc: Use image node_id 7 for calling the TransfoXLModelTester obj's underlying member method code with example usage: obj.create_transfo_xl_lm_head(config, input_ids_1, input_ids_2, lm_labels) and returns: outputs