运行 Tensorflow 单元测试 [英] Run Tensorflow unit tests
本文介绍了运行 Tensorflow 单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法手动运行 Tensorflow 单元测试?我想在修改 TF 源代码时执行健全性检查.
Is there any way to run Tensorflow unit tests manually? I want to perform sanity checks while modifying TF source code.
我看到有很多 _test.py 文件包含执行许多测试操作的类,但我不知道如何运行它们.应该有一个简单的方法?
I see there are many _test.py files with classes that perform many test operations and I can't figure out how to run them. There should be an easy way?
推荐答案
运行 TensorFlow 单元测试的最简单方法是使用 Bazel,假设您有 从 Git 下载源代码:
The easiest way to run the TensorFlow unit tests is using Bazel, assuming you have 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/...
这篇关于运行 Tensorflow 单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文