本文介绍了运行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单元测试
发布评论