unit-testing - 运行 Tensorflow 单元测试

标签 unit-testing tensorflow testing bazel

有什么方法可以手动运行 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/

相关文章:

python - `torch.gather` 不取消广播

java - gradle:禁用输出显式导致详细输出

c - 单元测试错误条件 - EINTR

java - EasyMock 不区分子类

python - 致命标志解析错误 :Unknown command line flag 'logtostderr'

tensorflow - 将 DROPOUT 添加到 Tensorflow CIFAR10 深度 CNN 示例

php - 使用 Yii2 进行代码接收,运行时出错

tomcat - Tomcat 上的平均最大并发用户数

unit-testing - 如何在实习生测试中模拟依赖关系

ios - 未找到 Bitrise.io 方案