class_docstr: An `ItemSelector` that selects the last `n` items in the batch.
docstr: Creates an instance of `LastNItemSelector`.
  
  Example:
  >>> selector = LastNItemSelector(2)
  >>> selection = selector.get_selection_mask(
  ...     tf.ragged.constant([[1, 2, 3, 4], [5, 6, 7]]), axis=1)
  >>> print(selection)
  <tf.RaggedTensor [[False, False, True, True], [False, True, True]]>
  
  Args:
    num_to_select: An int which is the leading number of items to select.
    unselectable_ids: (optional) A list of int ids that cannot be selected.
      Default is empty list.
docstr_tok: ["Creates","an","instance","of","`","LastNItemSelector","`",".","Example",":",">",">",">","selector","=","LastNItemSelector","(","2",")",">",">",">","selection","=","selector.get_selection_mask","(","...","tf.ragged.constant","(","[","[","1",",","2",",","3",",","4","]",",","[","5",",","6",",","7","]","]",")",",","axis=1",")",">",">",">","print","(","selection",")","<","tf.RaggedTensor","[","[","False",",","False",",","True",",","True","]",",","[","False",",","True",",","True","]","]",">","Args",":","num_to_select",":","An","int","which","is","the","leading","number","of","items","to","select",".","unselectable_ids",":","(","optional",")","A","list","of","int","ids","that","can","not","be","selected",".","Default","is","empty","list","."]
code: def __init__(self, num_to_select, unselectable_ids=None):
      """Creates an instance of `LastNItemSelector`.
  
      Example:
      >>> selector = LastNItemSelector(2)
      >>> selection = selector.get_selection_mask(
      ...     tf.ragged.constant([[1, 2, 3, 4], [5, 6, 7]]), axis=1)
      >>> print(selection)
      <tf.RaggedTensor [[False, False, True, True], [False, True, True]]>
  
      Args:
        num_to_select: An int which is the leading number of items to select.
        unselectable_ids: (optional) A list of int ids that cannot be selected.
          Default is empty list.
      """
      super().__init__(unselectable_ids)
      self._num_to_select = num_to_select
  
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import array_ops_stack
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import map_fn
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops.ragged import ragged_array_ops
  from tensorflow.python.ops.ragged import ragged_functional_ops
  from tensorflow.python.ops.ragged import ragged_math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
label_desc: Use image node_id 1 to create a new LastNItemSelector object from inherited base classes: ItemSelector with example: obj = LastNItemSelector(num_to_select, unselectable_ids)