code: def apply_linear(inputs, linear_modules, activation=tf.identity):
      """Computes linear, allowing for tuple inputs (processed in parallel).
  
      If inputs is a tuple, the linear modules must be a tuple or list of the same
      length.
  
      Args:
        inputs: tensor or list / tuple of 2 tensors.
        linear_modules: sonnet module, or list / tuple of 2 sonnet modules.
        activation: function to call as activation, default is identity.
  
      Returns:
        output Tensor from one / both linear modules.
      """
      tree.assert_same_structure(inputs, linear_modules)
      if isinstance(inputs, (tuple, list)):
          assert (
              len(inputs) == len(linear_modules) == 2
          ), "if inputs is a list, must be length 2 and match length of linears"
          return apply_split_linear(
              linear_modules[0],
              linear_modules[1],
              inputs[0],
              inputs[1],
              activation=activation,
          )
      else:
          return activation(linear_modules(inputs))
  
file_path: sonnet/sonnet/src/nets/dnc/util.py
imports: import numpy
  import tensorflow
  import tree
label_desc: Use image node_id 5 for calling a global function with example usage: apply_linear(inputs, linear_modules, activation) and returns: apply_split_linear, activation