(self, pianoroll, mask)
Call the wrapped predictor and return its output.
Call the wrapped predictor and return its output.
Call the wrapped predictor and return its output .
def __call__(self, pianoroll, mask):
    """Call the wrapped predictor and return its output."""
    if self.maxsize is not None and pianoroll.size > self.maxsize:
      return self._bisect(pianoroll, mask)
    try:
      return self.predictor(pianoroll, mask)
    except tf.errors.ResourceExhaustedError:
      if self.maxsize is None:
        self.maxsize = pianoroll.size
      self.maxsize = int(self.maxsize / 2)
      print('ResourceExhaustedError on batch of %s elements, lowering max size '
            'to %s' % (pianoroll.size, self.maxsize))
      return self._bisect(pianoroll, mask)
def __call__ ( self , pianoroll , mask ) : if self . maxsize is not None and pianoroll . size > self . maxsize : return self . _bisect ( pianoroll , mask ) try : return self . predictor ( pianoroll , mask ) except tf . errors . ResourceExhaustedError : if self . maxsize is None : self . maxsize = pianoroll . size self . maxsize = int ( self . maxsize / 2 ) print ( 'ResourceExhaustedError on batch of %s elements, lowering max size ' 'to %s' % ( pianoroll . size , self . maxsize ) ) return self . _bisect ( pianoroll , mask )