code: def filter_valids(t, valid, name="filter_valids"):
      """Filter out tensor using valid array.
  
      Args:
          t (tf.Tensor): The tensor to filter.
          valid (list[float]): Array of length of the valid values (either
              0 or 1).
          name (string): Name of the operation.
  
      Returns:
          tf.Tensor: Filtered Tensor.
      """
      # Must round before cast to prevent floating-error
      return tf.dynamic_partition(
          t, tf.cast(tf.round(valid), tf.int32), 2, name=name
      )[1]
  
imports: import collections
  import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: filter_valids(t, valid, name) and returns: tf