(self, feature_dict, new_unparsed_label)
return feature_dict
Replaces the label from the feature_dict with the new (soft) label.

    The function assumes that the new_unparsed_label contains a list of logits
    which will be converted to a soft label using the softmax.

    Args:
      feature_dict: A serialized TFRecord containing the old label.
      new_unparsed_label: A serialized TFRecord containing the new label.

    Returns:
      Updates the label in the label dict to the new soft label.
Replaces the label from the feature_dict with the new (soft) label.
Replaces the label from the feature_dict with the new ( soft ) label .
def _replace_label(self, feature_dict, new_unparsed_label):
    """Replaces the label from the feature_dict with the new (soft) label.

    The function assumes that the new_unparsed_label contains a list of logits
    which will be converted to a soft label using the softmax.

    Args:
      feature_dict: A serialized TFRecord containing the old label.
      new_unparsed_label: A serialized TFRecord containing the new label.

    Returns:
      Updates the label in the label dict to the new soft label.
    """
    label_spec = {
        "file_name": tf.FixedLenFeature((), tf.string),
        "label": tf.FixedLenFeature([self._num_classes], tf.float32)
    }
    parsed_label = tf.parse_single_example(new_unparsed_label, label_spec)
    with tf.control_dependencies([
        tf.assert_equal(parsed_label["file_name"], feature_dict["file_name"])]):
      feature_dict["label"] = tf.nn.softmax(logits=parsed_label["label"])
    return feature_dict
def _replace_label ( self , feature_dict , new_unparsed_label ) : label_spec = { "file_name" : tf . FixedLenFeature ( ( ) , tf . string ) , "label" : tf . FixedLenFeature ( [ self . _num_classes ] , tf . float32 ) } parsed_label = tf . parse_single_example ( new_unparsed_label , label_spec ) with tf . control_dependencies ( [ tf . assert_equal ( parsed_label [ "file_name" ] , feature_dict [ "file_name" ] ) ] ) : feature_dict [ "label" ] = tf . nn . softmax ( logits = parsed_label [ "label" ] ) return feature_dict