code: def split_outputs_per_head(
      outputs: Tuple[NDArray], heads: list
  ) -> List[List[NDArray]]:
      """
      Split outputs into outputs per head
      :param outputs: list of all outputs
      :param heads: list of all heads
      :return: list of outputs for each head
      """
      head_outputs = []
      for h in heads:
          head_outputs.append(list(outputs[: h.num_outputs]))
          outputs = outputs[h.num_outputs :]
      assert len(outputs) == 0
      return head_outputs
  
imports: import inspect
  from typing import Any, Dict, Generator, Iterable, List, Tuple, Union
  from types import ModuleType
  import mxnet
  from mxnet import gluon, nd
  from mxnet.ndarray import NDArray
  import numpy
  from rl_coach.core_types import GradientClippingMethod
label_desc: Use image node_id 4 for calling a global function with example usage: split_outputs_per_head(outputs, heads) and returns: head_outputs