(axes=None, debug=False)
return _filter_examples
Filters empty examples.

  Filters any example that has an array of size (0,) (if axes=None).
  Alternatively, checks only axes provided in `axes' list. Contrary to
  FilterByLength used with several elements with length_axis, here the example
  would be filtered if ANY of the dimensions listed in `axes' contains an empty
  array.

  Args:
    axes: list of indices to check, if None, all of them.
    debug: If true, emits a log everytime we filter out an empty example.

  Returns:
    Function filtering empty examples.
Filters empty examples.
Filters empty examples .
def FilterEmptyExamples(axes=None, debug=False):  # pylint: disable=invalid-name
  """Filters empty examples.

  Filters any example that has an array of size (0,) (if axes=None).
  Alternatively, checks only axes provided in `axes' list. Contrary to
  FilterByLength used with several elements with length_axis, here the example
  would be filtered if ANY of the dimensions listed in `axes' contains an empty
  array.

  Args:
    axes: list of indices to check, if None, all of them.
    debug: If true, emits a log everytime we filter out an empty example.

  Returns:
    Function filtering empty examples.
  """
  def _filter_examples(generator):
    for example in generator:
      correct = True
      for i, unused_tuple_element in enumerate(example):
        if axes is None or i in axes:
          if example[i].shape == (0,):
            correct = False
            break
      if correct:
        yield example
      elif debug:
        logging.info('Filtered example: %r', example)
  return _filter_examples
def FilterEmptyExamples ( axes = None , debug = False ) : # pylint: disable=invalid-name def _filter_examples ( generator ) : for example in generator : correct = True for i , unused_tuple_element in enumerate ( example ) : if axes is None or i in axes : if example [ i ] . shape == ( 0 , ) : correct = False break if correct : yield example elif debug : logging . info ( 'Filtered example: %r' , example ) return _filter_examples