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

    Furthermore, if the feature_dict contains a key for the file_name which
    identifies an instance, we double-check that the we are replacing the label
    of the correct instance.

    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 label.
Replaces the label from the feature_dict with the new label.
Replaces the label from the feature_dict with the new label .
def _replace_label(self, feature_dict, new_unparsed_label):
    """Replaces the label from the feature_dict with the new label.

    Furthermore, if the feature_dict contains a key for the file_name which
    identifies an instance, we double-check that the we are replacing the label
    of the correct instance.

    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 label.
    """
    label_spec = {
        "file_name": tf.FixedLenFeature((), tf.string),
        "label": tf.FixedLenFeature((), tf.int64),
    }
    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.identity(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 ( ( ) , tf . int64 ) , } 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 . identity ( parsed_label [ "label" ] ) return feature_dict