W3cubDocs

/TensorFlow Python

tf.FixedLenSequenceFeature

Class FixedLenSequenceFeature

Defined in tensorflow/python/ops/parsing_ops.py.

See the guide: Inputs and Readers > Converting

Configuration for parsing a variable-length input feature into a Tensor.

The resulting Tensor of parsing a single SequenceExample or Example has a static shape of [None] + shape and the specified dtype. The resulting Tensor of parsing a batch_size many Examples has a static shape of [batch_size, None] + shape and the specified dtype. The entries in the batch from different Examples will be padded with default_value to the maximum length present in the batch.

To treat a sparse input as dense, provide allow_missing=True; otherwise, the parse functions will fail on any examples missing this feature.

Fields:

  • shape: Shape of input data for dimension 2 and higher. First dimension is of variable length None.
  • dtype: Data type of input.
  • allow_missing: Whether to allow this feature to be missing from a feature list item. Is available only for parsing SequenceExample not for parsing Examples.
  • default_value: Scalar value to be used to pad multiple Examples to their maximum length. Irrelevant for parsing a single Example or SequenceExample. Defaults to "" for dtype string and 0 otherwise (optional).

Properties

allow_missing

Alias for field number 2

default_value

Alias for field number 3

dtype

Alias for field number 1

shape

Alias for field number 0

Methods

__new__

@staticmethod
__new__(
    cls,
    shape,
    dtype,
    allow_missing=False,
    default_value=None
)

Create new instance of FixedLenSequenceFeature(shape, dtype, allow_missing, default_value)

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/FixedLenSequenceFeature