class_docstr: A generator which tracks the min/max list length diffs for two paths.
class_docstr_tok: ["A","generator","which","tracks","the","min\/max","list","length","diffs","for","two","paths","."]
docstr: Updates the min and max lengths from new batch.
docstr_tok: ["Updates","the","min","and","max","lengths","from","new","batch","."]
code: def add_input(
      self, accumulator: MinMax, batch: input_batch.InputBatch
  ) -> MinMax:
      """Updates the min and max lengths from new batch."""
      try:
          left_lengths = batch.list_lengths(self._left_path)
      except KeyError:
          left_lengths = np.full(batch.record_batch.num_rows, 0)
      try:
          right_lengths = batch.list_lengths(self._right_path)
      except KeyError:
          right_lengths = np.full(batch.record_batch.num_rows, 0)
      diffs = left_lengths - right_lengths
  
      if self._required_paths:
          diffs = diffs[~batch.all_null_mask(*self._required_paths)]
  
      min_diff, max_diff = accumulator
      if diffs.size:
          min_diff = min(min_diff, np.min(diffs))
          max_diff = max(max_diff, np.max(diffs))
      return min_diff, max_diff
  
file_path: data-validation/tensorflow_data_validation/statistics/generators/constituents/length_diff_generator.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import input_batch
  from tensorflow_data_validation.statistics.generators import stats_generator
  from typing import Iterable, Optional, Text, Tuple, Union
label_desc: Use image node_id 5 for calling the LengthDiffGenerator obj's underlying member method code with example usage: obj.add_input(accumulator, batch) and returns: min_diff,  max_diff