code: def __call__(self, datum):
      if "input_mask" not in datum["data_row"].get_fields():
          raise RuntimeError("Smart truncate not supported")
      indexer = (
          datum["data_row"]
          .input_mask.reshape(-1, self.max_seq_length)
          .max(-2)
      )
      valid_length = self.range_idx[indexer.astype(bool)].max() + 1
      self.max_valid_length = max(self.max_valid_length, valid_length)
  
file_path: jiant/jiant/proj/main/preprocessing.py
imports: import numpy
  import torch
  import jiant.shared.caching
  import jiant.utils.torch_utils
  from jiant.tasks.core import FeaturizationSpec, TaskTypes
  from jiant.utils.display import maybe_tqdm, maybe_trange
label_desc: Use image node_id 2 for calling the MaxValidLengthRecorder obj's underlying member method code with example usage: obj.__call__(datum) without return types