code: def split_heads(x, n, k=False):
      if k:
          return tf.transpose(a=split_states(x, n), perm=[0, 2, 3, 1])
      else:
          return tf.transpose(a=split_states(x, n), perm=[0, 2, 1, 3])
  
imports: import functools
  import numpy
  import tensorflow
  from finetune.optimizers.recompute_grads import recompute_grad
  from finetune.util.shapes import shape_list, lengths_from_eos_idx
  from finetune.nn.activations import act_fns
  from finetune.nn.nn_utils import dropout, norm
label_desc: Use image node_id 7 for calling a global function with example usage: split_heads(x, n, k) and returns: tf, tf