parameters: (serialized,
                         names=None,
                         sparse_keys=None,
                         sparse_types=None,
                         dense_keys=None,
                         dense_types=None,
                         dense_defaults=None,
                         dense_shapes=None,
                         name=None)
docstring: Parses `Example` protos.
  
    Args:
      serialized: A vector (1-D Tensor) of strings, a batch of binary
        serialized `Example` protos.
      names: A vector (1-D Tensor) of strings (optional), the names of
        the serialized protos.
      sparse_keys: A list of string keys in the examples' features.
        The results for these keys will be returned as `SparseTensor` objects.
      sparse_types: A list of `DTypes` of the same length as `sparse_keys`.
        Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`),
        and `tf.string` (`BytesList`) are supported.
      dense_keys: A list of string keys in the examples' features.
        The results for these keys will be returned as `Tensor`s
      dense_types: A list of DTypes of the same length as `dense_keys`.
        Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`),
        and `tf.string` (`BytesList`) are supported.
      dense_defaults: A dict mapping string keys to `Tensor`s.
        The keys of the dict must match the dense_keys of the feature.
      dense_shapes: A list of tuples with the same length as `dense_keys`.
        The shape of the data for each dense feature referenced by `dense_keys`.
        Required for any input tensors identified by `dense_keys` whose shapes are
        anything other than `[]` or `[1]`.
      name: A name for this operation (optional).
  
    Returns:
      A `dict` mapping keys to `Tensor`s and `SparseTensor`s.
  
    Raises:
      ValueError: If sparse and dense key sets intersect, or input lengths do not
        match up.
docstring_summary: Parses `Example` protos.
docstring_tokens: Parses Example protos .
function: def _parse_example_raw(serialized,
                         names=None,
                         sparse_keys=None,
                         sparse_types=None,
                         dense_keys=None,
                         dense_types=None,
                         dense_defaults=None,
                         dense_shapes=None,
                         name=None):
    """Parses `Example` protos.
  
    Args:
      serialized: A vector (1-D Tensor) of strings, a batch of binary
        serialized `Example` protos.
      names: A vector (1-D Tensor) of strings (optional), the names of
        the serialized protos.
      sparse_keys: A list of string keys in the examples' features.
        The results for these keys will be returned as `SparseTensor` objects.
      sparse_types: A list of `DTypes` of the same length as `sparse_keys`.
        Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`),
        and `tf.string` (`BytesList`) are supported.
      dense_keys: A list of string keys in the examples' features.
        The results for these keys will be returned as `Tensor`s
      dense_types: A list of DTypes of the same length as `dense_keys`.
        Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`),
        and `tf.string` (`BytesList`) are supported.
      dense_defaults: A dict mapping string keys to `Tensor`s.
        The keys of the dict must match the dense_keys of the feature.
      dense_shapes: A list of tuples with the same length as `dense_keys`.
        The shape of the data for each dense feature referenced by `dense_keys`.
        Required for any input tensors identified by `dense_keys` whose shapes are
        anything other than `[]` or `[1]`.
      name: A name for this operation (optional).
  
    Returns:
      A `dict` mapping keys to `Tensor`s and `SparseTensor`s.
  
    Raises:
      ValueError: If sparse and dense key sets intersect, or input lengths do not
        match up.
    """
    with ops.name_scope(name, "ParseExample", [serialized, names]):
      names = [] if names is None else names
      dense_defaults = {} if dense_defaults is None else dense_defaults
      sparse_keys = [] if sparse_keys is None else sparse_keys
      sparse_types = [] if sparse_types is None else sparse_types
      dense_keys = [] if dense_keys is None else dense_keys
      dense_types = [] if dense_types is None else dense_types
      dense_shapes = (
          [[]] * len(dense_keys) if dense_shapes is None else dense_shapes)
  
      num_dense = len(dense_keys)
      num_sparse = len(sparse_keys)
  
      if len(dense_shapes) != num_dense:
        raise ValueError("len(dense_shapes) != len(dense_keys): %d vs. %d"
                         % (len(dense_shapes), num_dense))
      if len(dense_types) != num_dense:
        raise ValueError("len(dense_types) != len(num_dense): %d vs. %d"
                         % (len(dense_types), num_dense))
      if len(sparse_types) != num_sparse:
        raise ValueError("len(sparse_types) != len(sparse_keys): %d vs. %d"
                         % (len(sparse_types), num_sparse))
      if num_dense + num_sparse == 0:
        raise ValueError("Must provide at least one sparse key or dense key")
      if not set(dense_keys).isdisjoint(set(sparse_keys)):
        raise ValueError(
            "Dense and sparse keys must not intersect; intersection: %s" %
            set(dense_keys).intersection(set(sparse_keys)))
  
      dense_defaults_vec = []
      for i, key in enumerate(dense_keys):
        default_value = dense_defaults.get(key)
        if default_value is None:
          default_value = constant_op.constant([], dtype=dense_types[i])
        elif not isinstance(default_value, ops.Tensor):
          key_name = "key_" + re.sub("[^A-Za-z0-9_.\\-/]", "_", key)
          default_value = ops.convert_to_tensor(
              default_value, dtype=dense_types[i], name=key_name)
          default_value = array_ops.reshape(default_value, dense_shapes[i])
  
        dense_defaults_vec.append(default_value)
  
      dense_shapes = [tensor_shape.as_shape(shape).as_proto()
                      for shape in dense_shapes]
  
      # pylint: disable=protected-access
      outputs = gen_parsing_ops._parse_example(
          serialized=serialized,
          names=names,
          dense_defaults=dense_defaults_vec,
          sparse_keys=sparse_keys,
          sparse_types=sparse_types,
          dense_keys=dense_keys,
          dense_shapes=dense_shapes,
          name=name)
      # pylint: enable=protected-access
  
      (sparse_indices, sparse_values, sparse_shapes, dense_values) = outputs
  
      sparse_tensors = [ops.SparseTensor(ix, val, shape) for (ix, val, shape)
                        in zip(sparse_indices, sparse_values, sparse_shapes)]
  
      return dict(
          zip(sparse_keys + dense_keys, sparse_tensors + dense_values))
function_tokens: def _parse_example_raw ( serialized , names = None , sparse_keys = None , sparse_types = None , dense_keys = None , dense_types = None , dense_defaults = None , dense_shapes = None , name = None ) : with ops . name_scope ( name , "ParseExample" , [ serialized , names ] ) : names = [ ] if names is None else names dense_defaults = { } if dense_defaults is None else dense_defaults sparse_keys = [ ] if sparse_keys is None else sparse_keys sparse_types = [ ] if sparse_types is None else sparse_types dense_keys = [ ] if dense_keys is None else dense_keys dense_types = [ ] if dense_types is None else dense_types dense_shapes = ( [ [ ] ] * len ( dense_keys ) if dense_shapes is None else dense_shapes ) num_dense = len ( dense_keys ) num_sparse = len ( sparse_keys ) if len ( dense_shapes ) != num_dense : raise ValueError ( "len(dense_shapes) != len(dense_keys): %d vs. %d" % ( len ( dense_shapes ) , num_dense ) ) if len ( dense_types ) != num_dense : raise ValueError ( "len(dense_types) != len(num_dense): %d vs. %d" % ( len ( dense_types ) , num_dense ) ) if len ( sparse_types ) != num_sparse : raise ValueError ( "len(sparse_types) != len(sparse_keys): %d vs. %d" % ( len ( sparse_types ) , num_sparse ) ) if num_dense + num_sparse == 0 : raise ValueError ( "Must provide at least one sparse key or dense key" ) if not set ( dense_keys ) . isdisjoint ( set ( sparse_keys ) ) : raise ValueError ( "Dense and sparse keys must not intersect; intersection: %s" % set ( dense_keys ) . intersection ( set ( sparse_keys ) ) ) dense_defaults_vec = [ ] for i , key in enumerate ( dense_keys ) : default_value = dense_defaults . get ( key ) if default_value is None : default_value = constant_op . constant ( [ ] , dtype = dense_types [ i ] ) elif not isinstance ( default_value , ops . Tensor ) : key_name = "key_" + re . sub ( "[^A-Za-z0-9_.\\-/]" , "_" , key ) default_value = ops . convert_to_tensor ( default_value , dtype = dense_types [ i ] , name = key_name ) default_value = array_ops . reshape ( default_value , dense_shapes [ i ] ) dense_defaults_vec . append ( default_value ) dense_shapes = [ tensor_shape . as_shape ( shape ) . as_proto ( ) for shape in dense_shapes ] # pylint: disable=protected-access outputs = gen_parsing_ops . _parse_example ( serialized = serialized , names = names , dense_defaults = dense_defaults_vec , sparse_keys = sparse_keys , sparse_types = sparse_types , dense_keys = dense_keys , dense_shapes = dense_shapes , name = name ) # pylint: enable=protected-access ( sparse_indices , sparse_values , sparse_shapes , dense_values ) = outputs sparse_tensors = [ ops . SparseTensor ( ix , val , shape ) for ( ix , val , shape ) in zip ( sparse_indices , sparse_values , sparse_shapes ) ] return dict ( zip ( sparse_keys + dense_keys , sparse_tensors + dense_values ) )