Utilities

tf.test.assert_equal_graph_def(actual, expected)

Asserts that two GraphDefs are (mostly) the same.

Compares two GraphDef protos for equality, ignoring versions and ordering of nodes, attrs, and control inputs. Node names are used to match up nodes between the graphs, so the naming of nodes must be consistent.

Args:
  • actual: The GraphDef we have.
  • expected: The GraphDef we expected.
Raises:
  • AssertionError: If the GraphDefs do not match.
  • TypeError: If either argument is not a GraphDef.

tf.test.get_temp_dir()

Returns a temporary directory for use during tests.

There is no need to delete the directory after the test.

Returns:

The temporary directory.


tf.test.is_built_with_cuda()

Returns whether TensorFlow was built with CUDA (GPU) support.