有什么方法可以手动运行 Tensorflow 单元测试吗?我想在修改 TF 源代码时执行健全性检查。
我看到有许多 _test.py 文件包含执行许多测试操作的类,但我不知道如何运行它们。应该有一个简单的方法吗?
最佳答案
运行 TensorFlow 单元测试的最简单方法是使用 Bazel,假设您有 downloaded the source from Git :
# All tests (for C++ changes).
$ bazel test //tensorflow/...
# All Python tests (for Python front-end changes).
$ bazel test //tensorflow/python/...
# All tests (with GPU support).
$ bazel test -c opt --config=cuda //tensorflow/...
$ bazel test -c opt --config=cuda //tensorflow/python/...
关于unit-testing - 运行 Tensorflow 单元测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34204551/