code: def _unpack_router_logits(self, router_outputs):
      total_router_logits = []
      total_expert_indexes = []
      for router_output in router_outputs:
          if len(router_output[0].shape) > 1:
              router_logits, expert_indexes = router_output
              total_router_logits.append(router_logits)
              total_expert_indexes.append(expert_indexes)
      return torch.cat(total_router_logits, dim=1), torch.cat(
          total_expert_indexes, dim=1
      )
  
imports: import copy
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn
  from ...activations import ACT2FN
  from ...modeling_outputs import MoECausalLMOutputWithPast, MoEModelOutputWithPastAndCrossAttentions
  from ...modeling_utils import PreTrainedModel
  from ...utils import DUMMY_INPUTS, DUMMY_MASK, add_start_docstrings, add_start_docstrings_to_model_forward, is_torch_fx_proxy, logging
  from .configuration_gptsan_japanese import GPTSanJapaneseConfig
label_desc: Use image node_id 11 for calling the GPTSanJapaneseForConditionalGeneration obj's underlying member method code with example usage: obj._unpack_router_logits(router_outputs) and returns: torch,  torch