title: Converting a list of unequally shaped arrays to Tensorflow 2 Dataset: ValueError: Can't convert non-rectangular Python sequence to Tensor
body: <p>I have tokenized data in the form of a list of <strong>unequally shaped</strong> arrays:</p>
  
  <pre><code>array([array([1179,    6,  208,    2, 1625,   92,    9, 3870,    3, 2136,  435,
            5, 2453, 2180,   44,    1,  226,  166,    3, 4409,   49, 6728,
           ...
           10,   17, 1396,  106, 8002, 7968,  111,   33, 1130,   60,  181,
         7988, 7974, 7970])], dtype=object)
  </code></pre>
  
  <p>With their respective targets:</p>
  
  <pre><code>Out[74]: array([0, 0, 0, ..., 0, 0, 1], dtype=object)
  </code></pre>
  
  <p>I'm trying to transform them into a padded <code>tf.data.Dataset()</code>, but it won't let me convert unequal shapes to a tensor. I will get this error:</p>
  
  <pre><code>ValueError: Can't convert non-rectangular Python sequence to Tensor.
  </code></pre>
  
  <p>The full code is here. Assume that my starting point is after <code>y = ...</code>:</p>
  
  <pre><code>import os
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
  import tensorflow as tf
  import tensorflow_datasets as tfds
  import numpy as np
  
  (train_data, test_data) = tfds.load('imdb_reviews/subwords8k',
                                      split=(tfds.Split.TRAIN, tfds.Split.TEST),
                                      as_supervised=True)
  
  x = np.array(list(train_data.as_numpy_iterator()))[:, 0]
  y = np.array(list(train_data.as_numpy_iterator()))[:, 1]
  
  
  train_tensor = tf.data.Dataset.from_tensor_slices((x.tolist(), y))\
      .padded_batch(batch_size=8, padded_shapes=([None], ()))
  </code></pre>
  
  <p>What are my options to turn this into a <strong>padded batch</strong> tensor?</p>