class_docstr: Truncates a list of segments using a pre-determined truncation strategy.
class_docstr_tok: ["Truncates","a","list","of","segments","using","a","pre-determined","truncation","strategy","."]
docstr: Generates a boolean mask specifying which portions of `segments` to drop.
  
  Users should be able to use the results of generate_mask() to drop items
  in segments using `tf.ragged.boolean_mask(seg, mask)`.
  
  Args:
    segments: A list of `RaggedTensor` each w/ a shape of [num_batch,
      (num_items)].
  
  Returns:
    a list with len(segments) number of items and where each item is a
    `RaggedTensor` with the same shape as its counterpart in `segments` and
    with a boolean dtype where each value is True if the corresponding
    value in `segments` should be kept and False if it should be dropped
    instead.
docstr_tok: ["Generates","a","boolean","mask","specifying","which","portions","of","`","segments","`","to","drop",".","Users","should","be","able","to","use","the","results","of","generate_mask","(",")","to","drop","items","in","segments","using","`","tf.ragged.boolean_mask","(","seg",",","mask",")","`",".","Args",":","segments",":","A","list","of","`","RaggedTensor","`","each","w\/","a","shape","of","[","num_batch",",","(","num_items",")","]",".","Returns",":","a","list","with","len","(","segments",")","number","of","items","and","where","each","item","is","a","`","RaggedTensor","`","with","the","same","shape","as","its","counterpart","in","`","segments","`","and","with","a","boolean","dtype","where","each","value","is","True","if","the","corresponding","value","in","`","segments","`","should","be","kept","and","False","if","it","should","be","dropped","instead","."]
code: def generate_mask(self, segments):
      """Generates a boolean mask specifying which portions of `segments` to drop.
  
      Users should be able to use the results of generate_mask() to drop items
      in segments using `tf.ragged.boolean_mask(seg, mask)`.
  
      Args:
        segments: A list of `RaggedTensor` each w/ a shape of [num_batch,
          (num_items)].
  
      Returns:
        a list with len(segments) number of items and where each item is a
        `RaggedTensor` with the same shape as its counterpart in `segments` and
        with a boolean dtype where each value is True if the corresponding
        value in `segments` should be kept and False if it should be dropped
        instead.
      """
      raise NotImplementedError()
  
imports: import abc
  from tensorflow.python.framework import constant_op
  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 math_ops
  from tensorflow.python.ops.ragged import ragged_array_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow_text.python.ops import item_selector_ops
  from tensorflow.python.framework import load_library
  from tensorflow.python.platform import resource_loader
  from tensorflow.python.ops import while_loop
label_desc: Use image node_id 2 for calling the Trimmer obj's underlying member method code with example usage: obj.generate_mask(segments) without return types