Advent of Code 2021 in pure TensorFlow - day 3. TensorArray and their limitations

As I anticipated, I started this series on how to use TensorFlow for solving the Advent of Code 2021 puzzles.

In this article, I show how I solved the day 3 puzzle. You’ll learn about TensorArrays, how to use them and I’ll also present a huge limitation this data type has.

Moreover, I’ll show how and why to use a tf.function experimental (but very useful) feature for avoiding useless retraces and reusing the same graph with tensors of different shapes.

I already solved days 4 and 5, hence two new articles will come soon!

1 Like