(way, labels)
return tf.reduce_sum(tf.cast(is_equal, tf.int32), axis=1)
Computes the `shot` of the episode containing labels.

  Args:
    way: An int constant tensor. The number of classes in the episode.
    labels: A Tensor of labels of shape [batch_size].

  Returns:
    shots: An int 1D tensor: The number of support examples per class.
Computes the `shot` of the episode containing labels.
Computes the shot of the episode containing labels .
def compute_shot(way, labels):
  """Computes the `shot` of the episode containing labels.

  Args:
    way: An int constant tensor. The number of classes in the episode.
    labels: A Tensor of labels of shape [batch_size].

  Returns:
    shots: An int 1D tensor: The number of support examples per class.
  """
  class_ids = tf.reshape(tf.range(way), [way, 1])
  class_labels = tf.reshape(labels, [1, -1])
  is_equal = tf.equal(class_labels, class_ids)
  return tf.reduce_sum(tf.cast(is_equal, tf.int32), axis=1)
def compute_shot ( way , labels ) : class_ids = tf . reshape ( tf . range ( way ) , [ way , 1 ] ) class_labels = tf . reshape ( labels , [ 1 , - 1 ] ) is_equal = tf . equal ( class_labels , class_ids ) return tf . reduce_sum ( tf . cast ( is_equal , tf . int32 ) , axis = 1 )