code: def _make_output_layer(
      output_layer, vocab_size, output_layer_bias, variable_scope
  ):
      """Makes a decoder output layer."""
      _vocab_size = vocab_size
      if is_callable(output_layer):
          _output_layer = output_layer
      elif tf.contrib.framework.is_tensor(output_layer):
          _vocab_size = shape_list(output_layer)[1]
          _output_layer = _make_output_layer_from_tensor(
              output_layer,
              _vocab_size,
              output_layer_bias,
              variable_scope,
          )
      elif output_layer is None:
          if _vocab_size is None:
              raise ValueError(
                  "Either `output_layer` or `vocab_size` must be provided. "
                  "Set `output_layer=tf.identity` if no output layer is "
                  "wanted."
              )
          with tf.variable_scope(variable_scope):
              # pylint: disable=redefined-variable-type
              _output_layer = tf.layers.Dense(
                  units=_vocab_size, use_bias=output_layer_bias
              )
      else:
          raise ValueError(
              "output_layer should be a callable layer, a tensor, or None. "
              "Unsupported type: ",
              type(output_layer),
          )
  
      return _output_layer, _vocab_size
  
imports: import copy
  import tensorflow
  from tensorflow.contrib.seq2seq import Decoder
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.util import nest
  from texar.tf.core import layers
  from texar.tf.utils import utils
  from texar.tf.utils.mode import is_train_mode, is_train_mode_py
  from texar.tf.modules.decoders.dynamic_decode import dynamic_decode
  from texar.tf.module_base import ModuleBase
  from texar.tf.modules.decoders import rnn_decoder_helpers
  from texar.tf.utils.dtypes import is_callable
  from texar.tf.utils.shapes import shape_list
  from texar.tf.modules.decoders import tf_helpers
label_desc: Use image node_id 2 for calling a global function with example usage: _make_output_layer(output_layer, vocab_size, output_layer_bias, variable_scope) and returns: _output_layer,  _vocab_size