class_docstr: A class encapsulating the logic for selecting items.
  
  `ItemSelector` implementations contain algorithms for selecting items in a
  `RaggedTensor`. Users of `ItemSelector` implementations can call
  `get_selection_mask()` to retrieve a bool `RaggedTensor` mask indicating the
  items that have been selected. For example:
  
  >>> inputs = tf.ragged.constant([
  ...     [1, 2, 3, 4],
  ...     [100, 200]
  ...   ])
  >>> tf.random.set_seed(1234)
  >>> selector = RandomItemSelector(3, .5)
  >>> selected = selector.get_selection_mask(inputs, axis=1)
  >>> print(selected)
  <tf.RaggedTensor [[False, True, True, False],
                    [False, True]]>
  
  
  An important use case for these classes is in creating inputs for masked
  language model training dataset preparation. See `masked_language_model` for
  an example of using the selectors in such a context.
  
  Subclass writers will typically implement a selection algorithm by overriding
  `get_selection_mask()`.
  
  A helper function `get_selectable()` is provided to help subclass writers
  filter out excluded items from selection (e.g. CLS and SEP for bert style
  models). This will frequently serve as a prefilter for subclass item
  selection (see e.g. the implementation of `RandomItemSelector`. The base class
  behavior is to simply return the mask obtained by filtering out items listed
  in `unselectable_ids`.
docstr: Returns a mask of items that have been selected.
  
  The default implementation simply returns all items not excluded by
  `get_selectable`.
  
  Args:
    input_ids: A `RaggedTensor`.
    axis: (optional) An int detailing the dimension to apply selection on.
      Default is the 1st dimension.
  
  Returns:
    a `RaggedTensor` with shape `input_ids.shape[:axis]`. Its values are True
    if the corresponding item (or broadcasted subitems) should be selected.
docstr_tok: ["Returns","a","mask","of","items","that","have","been","selected",".","The","default","implementation","simply","returns","all","items","not","excluded","by","`","get_selectable","`",".","Args",":","input_ids",":","A","`","RaggedTensor","`",".","axis",":","(","optional",")","An","int","detailing","the","dimension","to","apply","selection","on",".","Default","is","the","1st","dimension",".","Returns",":","a","`","RaggedTensor","`","with","shape","`","input_ids.shape","[",":","axis","]","`",".","Its","values","are","True","if","the","corresponding","item","(","or","broadcasted","subitems",")","should","be","selected","."]
code: def get_selection_mask(self, input_ids, axis=1):
      """Returns a mask of items that have been selected.
  
      The default implementation simply returns all items not excluded by
      `get_selectable`.
  
      Args:
        input_ids: A `RaggedTensor`.
        axis: (optional) An int detailing the dimension to apply selection on.
          Default is the 1st dimension.
  
      Returns:
        a `RaggedTensor` with shape `input_ids.shape[:axis]`. Its values are True
        if the corresponding item (or broadcasted subitems) should be selected.
      """
      return self.get_selectable(input_ids, axis)
  
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 4 for calling the ItemSelector obj's underlying member method code with example usage: obj.get_selection_mask(input_ids, axis) and returns: self