class_docstr: Feature extractor for images using a regular CNN.
  
  By using the notion of an "endpoint", we truncate a classification CNN at
  a certain layer output, and return this partial feature map to be used as
  a good image representation for other ML tasks.
docstr: Returns a list of the variables that are trainable.
  
  Returns:
      trainable_variables: a tuple of `tf.Variable`.
docstr_tok: ["Returns","a","list","of","the","variables","that","are","trainable",".","Returns",":","trainable_variables",":","a","tuple","of","`","tf.Variable","`","."]
code: def get_trainable_vars(self):
      """
      Returns a list of the variables that are trainable.
  
      Returns:
          trainable_variables: a tuple of `tf.Variable`.
      """
      all_trainable = super(
          TruncatedBaseNetwork, self
      ).get_trainable_vars()
  
      # Get the index of the last endpoint scope variable.
      # For example, if the endpoint for ResNet-50 is set as
      # "block4/unit_3/bottleneck_v1/conv2", then it will get 155,
      # because the variables (with their indexes) are:
      #   153 block4/unit_3/bottleneck_v1/conv2/weights:0
      #   154 block4/unit_3/bottleneck_v1/conv2/BatchNorm/beta:0
      #   155 block4/unit_3/bottleneck_v1/conv2/BatchNorm/gamma:0
      var_iter = enumerate(v.name for v in all_trainable)
      scope_var_index_iter = (
          i for i, name in var_iter if self._endpoint in name
      )
      index = None
      for index in scope_var_index_iter:
          pass
  
      if index is None:
          # Resulting `trainable_vars` is empty, possibly due to the
          # `fine_tune_from` starting after the endpoint.
          trainable_vars = tuple()
      else:
          trainable_vars = all_trainable[: index + 1]
  
      if self._use_tail and not self._freeze_tail:
          if self._architecture == "resnet_v1_101":
              # Retrieve the trainable vars out of the tail.
              # TODO: Tail should be configurable too, to avoid hard-coding
              # the trainable portion to `block4` and allow using something
              # in block4 as endpoint.
              var_iter = enumerate(v.name for v in all_trainable)
              try:
                  index = next(
                      i for i, name in var_iter if "block4" in name
                  )
              except StopIteration:
                  raise ValueError(
                      '"block4" not present in the trainable vars retrieved '
                      "from base network."
                  )
              trainable_vars += all_trainable[index:]
  
      return trainable_vars
  
file_path: luminoth/luminoth/models/base/truncated_base_network.py
imports: import tensorflow
  import tensorflow.contrib.slim
  from tensorflow.contrib.slim.nets import resnet_utils, resnet_v1
  from luminoth.models.base import BaseNetwork
label_desc: Use image node_id 4 for calling the TruncatedBaseNetwork obj's underlying member method code with example usage: obj.get_trainable_vars() and returns: trainable_vars