tf.io.FixedLenSequenceFeature shows error when padding value for unformant serialized features
@Zaoyee The error indicates the number of values in the sequence feature with name f1 does not match the expected output shape, which is [] (empty shape).  FixedLenSequenceFeature expects all lists to have a length of 3. 

To fix the error, you can either ensure that all lists in the sequence have the same length, or you can use a VarLenFeature to allow sequences of different lengths. Hope this helps.

 Thanks for your quick reply. @apmanikandan 

I was expected `FixedLenSequenceFeature` is able to pad a default value for the missing, as shown in API doc.
I checked the doc,  the comment shows it should allow me to get a dense result for the sequence data instead of using `VarLenFeature` for sparse result.

Is it possible to handle that? Hi @Zaoyee ,

Could you please fill the issue in the attached format [here](https://github.com/tensorflow/tensorflow/issues/new?assignees=&labels=&template=tensorflow_issue_template.yaml).

I tried replicating the issue and refer to attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/99735ae7c767698a830247589af4329a/59950.ipynb#scrollTo=yqLOC68gFeGk). It seems there is some difference in error trace.Could you please check and confirm. Thanks!
 @Zaoyee ,

I did some debugging here.For `tf.io.FixedLenSequenceFeature()` if passed `default_value=None` the reported error by you arising.If I pass the Input as Non Ragged Tensor then the error will be gone. 
I assume you are trying to pass input as Sparse tensor and padding it with some default value(`"-1"` here).This seems not supported by the API `tf.io.parse_single_sequence_example`. 

From the API `tf.io.FixedLenSequenceFeature()` see the highlighted line for the argument `default_value` below. 


> 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).

This states this is irrelevant for parsing a single example or SeqneceExample in our case we have used the API `tf.io.parse_single_sequence_example` which is used for parsing a single SequenceExample proto.Combination of both are not allowed.

I hope this explains the reason for the error.Please also refer to the attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/2cab24cfe2e4f66ecdfed99eef6bf101/59950_r1.ipynb).

 @SuryanarayanaY ,

Really appreciate your work. I understand what you say, but the method description still confuse me.
The following is descripted in `parsing_ops.py`.
>  `sequence_features` contains `VarLenFeature`, `RaggedFeature`, and
  `FixedLenSequenceFeature` objects. Each `VarLenFeature` is mapped to a
  `SparseTensor`; each `RaggedFeature` is mapped to a `RaggedTensor`; and each
  `FixedLenSequenceFeature` is mapped to a `Tensor`, each of the specified type.
  The shape will be `(T,) + df.dense_shape` for `FixedLenSequenceFeature` `df`,
  where `T` is the length of the associated `FeatureList` in the
  `SequenceExample`. For instance, `FixedLenSequenceFeature([])` yields a scalar
  1-D `Tensor` of static shape `[None]` and dynamic shape `[T]`, while
  `FixedLenSequenceFeature([k])` (for `int k >= 1`) yields a 2-D matrix `Tensor`
  of static shape `[None, k]` and dynamic shape `[T, k]`.

, which i understand should allow me to use a general `FixedLenSequenceFeature` for `tf.io.parse_single_sequence_example`.

Besides, i was wondering if I am able to parse the `**'actors'**` features in the [example](https://www.tensorflow.org/api_docs/python/tf/train/SequenceExample) using ``FixedLenSequenceFeature``.
/
```
  context: {
    feature: {
      key  : "locale"
      value: {
        bytes_list: {
          value: [ "pt_BR" ]
        }
      }
    }
    feature: {
      key  : "age"
      value: {
        float_list: {
          value: [ 19.0 ]
        }
      }
    }
    feature: {
      key  : "favorites"
      value: {
        bytes_list: {
          value: [ "Majesty Rose", "Savannah Outen", "One Direction" ]
        }
      }
    }
  }
  feature_lists: {
    feature_list: {
      key  : "movie_ratings"
      value: {
        feature: {
          float_list: {
            value: [ 4.5 ]
          }
        }
        feature: {
          float_list: {
            value: [ 5.0 ]
          }
        }
      }
    }
    feature_list: {
      key  : "movie_names"
      value: {
        feature: {
          bytes_list: {
            value: [ "The Shawshank Redemption" ]
          }
        }
        feature: {
          bytes_list: {
            value: [ "Fight Club" ]
          }
        }
      }
    }
    feature_list: {
      key  : "actors"
      value: {
        feature: {
          bytes_list: {
            value: [ "Tim Robbins", "Morgan Freeman" ]
          }
        }
        feature: {
          bytes_list: {
            value: [ "Brad Pitt", "Edward Norton", "Helena Bonham Carter" ]
          }
        }
      }
    }
  }
``` @Zaoyee ,

For this case it seems `tf.io.parse_single_sequence_example` not working when `context_features =FixedLenSequenceFeature()` with Sparse input. Workaround seems to use` tf.io.VarLenFeature()` instead of `FixedLenSequenceFeature()`. Could you confirm whether this works for your case or do you have your case to use only with` FixedLenSequenceFeature()` ?  This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59950">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59950">No</a>

I got an error when deserialize the data like the following code.

the sequence data would be like 

```
feature_list {
    key: "f1"
    value {
      feature {
        int64_list {
          value: 1
          value: 2
        }
      }
      feature {
        int64_list {
          value: 1
          value: 0
          value: 2
        }
      }
    }
```

I want to use ```tf.io.FixedLenSequenceFeature``` to fit sequence data into a dense tensor with padded value -1.

```python
import tensorflow as tf

if __name__ == '__main__':
  sequence_feature_names = "f1"
  featurelists = {}
  x = [[1,2], [1, 0, 2]]
  feature_list = tf.train.FeatureList(
    feature=[tf.train.Feature(int64_list=tf.train.Int64List(value=x_)) for x_ in x])
  featurelists[sequence_feature_names] = feature_list
  featurelists_features = tf.train.FeatureLists(feature_list=featurelists)
  sequence_example = tf.train.SequenceExample(
    context=None,
    feature_lists=featurelists_features
  )

  print(sequence_example)
  data = sequence_example.SerializeToString()
  des_data = tf.io.parse_single_sequence_example(data,
                                          context_features={},
                                          sequence_features={
                                            # 'sequence_feature_1': tf.io.VarLenFeature(dtype='int64'),
                                            'f1': tf.io.FixedLenSequenceFeature(shape=[3], dtype=tf.int64,
                                                                                allow_missing=True, default_value=-1
                                                                                  )
                                          }, )
  print(des_data)
  print(tf.sparse.to_dense(des_data[1]['sequence_feature_1']))

```

The traceback is like:
```
Traceback (most recent call last):
  File "D:/cloud-service-ai/dev/fc-dev/honor-feature-columns/tests/parse_seq_example.py", line 28, in <module>
    des_data = tf.io.parse_single_sequence_example(data,
  File "D:\Libraries\Anaconda3\envs\tf2py38\lib\site-packages\tensorflow\python\util\traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "D:\Libraries\Anaconda3\envs\tf2py38\lib\site-packages\tensorflow\python\eager\execute.py", line 54, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__ParseSequenceExampleV2_Ncontext_sparse_0_Nfeature_list_dense_1_Nfeature_list_sparse_0_Tcontext_dense_0_context_ragged_split_types_0_context_ragged_value_types_0_context_sparse_types_0_feature_list_dense_types_1_feature_list_ragged_split_types_0_feature_list_ragged_value_types_0_feature_list_sparse_types_0_device_/job:localhost/replica:0/task:0/device:CPU:0}} Name: <unknown>, Key: sequence_feature_1, Index: 0.  Number of values != expected.  values size: 2 but output shape: [] [Op:ParseSequenceExampleV2]

```

···