since my GPU only support TensorFlow 2.x, I have to rewrite a code which is written in TensorFlow 1.x .

I used the following code: https://www.tensorflow.org/guide/upgrade

Everything worked fine until I came to the following function:

```
tf.contrib.training.bucket_by_sequence_length(input_length,
tensors,
batch_size,
bucket_boundaries,
num_threads=1,
capacity=32,
bucket_capacities=None,
shapes=None,
dynamic_pad=False,
allow_smaller_final_batch=False,
keep_input=True,
shared_name=None,
name=None)
```

Unfortunately therefore I haven’t a solution how to rewrite this code.

I am glad for any idea how to solve this problem.

Source: Python Questions