class_docstr: A wrapper for predictor functions that automatically adapts batch size.
  
  Predictor functions are functions that take batched model inputs and return
  batched model outputs. RobustPredictor partitions the batch in response to
  ResourceExhaustedErrors, making multiple calls to the wrapped predictor to
  process the entire batch.
class_docstr_tok: ["A","wrapper","for","predictor","functions","that","automatically","adapts","batch","size",".","Predictor","functions","are","functions","that","take","batched","model","inputs","and","return","batched","model","outputs",".","RobustPredictor","partitions","the","batch","in","response","to","ResourceExhaustedErrors",",","making","multiple","calls","to","the","wrapped","predictor","to","process","the","entire","batch","."]
code: def _bisect(self, pianoroll, mask):
      i = int(len(pianoroll) / 2)
      if i == 0:
          raise ValueError("Batch size is zero!")
      return np.concatenate(
          [
              self(pianoroll[:i], mask[:i]),
              self(pianoroll[i:], mask[i:]),
          ],
          axis=0,
      )
  
file_path: magenta/magenta/models/coconet/lib_tfutil.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the RobustPredictor obj's underlying member method code with example usage: obj._bisect(pianoroll, mask) and returns: np