Mak*_*nko 22 testing unit-testing bazel tensorflow
有没有办法手动运行Tensorflow单元测试?我想在修改TF源代码时执行完整性检查.
我看到有很多_test.py文件,其中的类执行许多测试操作,我无法弄清楚如何运行它们.应该有一个简单的方法吗?
mrr*_*rry 31
假设您从Git下载了源代码,运行TensorFlow单元测试的最简单方法是使用Bazel :
# 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/...
Run Code Online (Sandbox Code Playgroud)
除了上述答案之外,您还可以运行所示的单独测试而不是完整的包,这可以节省大量时间。
bazel run //tensorflow/python/kernel_tests:string_split_op_test
bazel run //tensorflow/python:special_math_ops_test
Run Code Online (Sandbox Code Playgroud)
或者您可以转到单独的目录并在那里运行所有测试
cd python/kernel_tests
bazel run :one_hot_op_test
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
9274 次 |
最近记录: |