コード例 #1
0
def _ParseSequenceExample(record, feature_map, context_map):
    """Parse a SequenceExample, adding the context features to the features."""
    context, features = tf.parse_single_sequence_example(
        serialized=record,
        context_features=context_map,
        sequence_features=feature_map)
    # Add all keys from context to features. Keys must not overlap.
    common_keys = set(context.keys()) & set(features.keys())
    if common_keys:
        raise ValueError(
            'Keys {} are present in context and features.'.format(common_keys))
    features.update(context)
    return features
コード例 #2
0
def _ParseSequenceExample(record, feature_map):
    _, features = tf.parse_single_sequence_example(
        serialized=record,
        context_features=None,
        sequence_features=feature_map)
    return features