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 the endpoint tensor from the list of possible endpoints.
  
  Since we already have a dictionary with variable names we should be
  able to get the desired tensor directly. Unfortunately the variable
  names change with scope and the scope changes between TensorFlow
  versions. We opted to just select the tensor for which the variable
  name ends with the endpoint name we want (it should be just one).
  
  Args:
      endpoints: a dictionary with {variable_name: tensor}.
  
  Returns:
      endpoint_value: a tensor.
docstr_tok: ["Returns","the","endpoint","tensor","from","the","list","of","possible","endpoints",".","Since","we","already","have","a","dictionary","with","variable","names","we","should","be","able","to","get","the","desired","tensor","directly",".","Unfortunately","the","variable","names","change","with","scope","and","the","scope","changes","between","TensorFlow","versions",".","We","opted","to","just","select","the","tensor","for","which","the","variable","name","ends","with","the","endpoint","name","we","want","(","it","should","be","just","one",")",".","Args",":","endpoints",":","a","dictionary","with","{","variable_name",":","tensor","}",".","Returns",":","endpoint_value",":","a","tensor","."]
code: def _get_endpoint(self, endpoints):
      """
      Returns the endpoint tensor from the list of possible endpoints.
  
      Since we already have a dictionary with variable names we should be
      able to get the desired tensor directly. Unfortunately the variable
      names change with scope and the scope changes between TensorFlow
      versions. We opted to just select the tensor for which the variable
      name ends with the endpoint name we want (it should be just one).
  
      Args:
          endpoints: a dictionary with {variable_name: tensor}.
  
      Returns:
          endpoint_value: a tensor.
      """
      for endpoint_key, endpoint_value in endpoints.items():
          if endpoint_key.endswith(self._scope_endpoint):
              return endpoint_value
  
      raise ValueError(
          '"{}" is an invalid value of endpoint for this '
          "architecture.".format(self._scope_endpoint)
      )
  
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 5 for calling the TruncatedBaseNetwork obj's underlying member method code with example usage: obj._get_endpoint(endpoints) and returns: endpoint_value