(example_strings, class_ids)
return (actual_example_strings, actual_class_ids)
Returns tensors with only actual examples, filtering out the placeholders.

  Actual examples are the first ones in the tensors, and followed by placeholder
  ones, indicated by negative class IDs.

  Args:
    example_strings: 1-D Tensor of dtype str, Example protocol buffers.
    class_ids: 1-D Tensor of dtype int, class IDs (absolute wrt the original
      dataset, except for negative ones, that indicate placeholder examples).
Returns tensors with only actual examples, filtering out the placeholders.
Returns tensors with only actual examples filtering out the placeholders .
def filter_placeholders(example_strings, class_ids):
  """Returns tensors with only actual examples, filtering out the placeholders.

  Actual examples are the first ones in the tensors, and followed by placeholder
  ones, indicated by negative class IDs.

  Args:
    example_strings: 1-D Tensor of dtype str, Example protocol buffers.
    class_ids: 1-D Tensor of dtype int, class IDs (absolute wrt the original
      dataset, except for negative ones, that indicate placeholder examples).
  """
  num_actual = tf.reduce_sum(tf.cast(class_ids >= 0, tf.int32))
  actual_example_strings = example_strings[:num_actual]
  actual_class_ids = class_ids[:num_actual]
  return (actual_example_strings, actual_class_ids)
def filter_placeholders ( example_strings , class_ids ) : num_actual = tf . reduce_sum ( tf . cast ( class_ids >= 0 , tf . int32 ) ) actual_example_strings = example_strings [ : num_actual ] actual_class_ids = class_ids [ : num_actual ] return ( actual_example_strings , actual_class_ids )