How it works...

In this section, we implemented three types of unit tests: Tensor values, operations outputs, and Tensor shapes. There are more types of unit test functions for TensorFlow, and they can be found here: https://www.tensorflow.org/versions/master/api_docs/python/test.html.

Remember that unit testing helps assure us that code will function as expected, provides confidence in sharing code, and makes reproducibility more accessible.

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.