运行Tensorflow单元测试 [英] Run Tensorflow unit tests

查看:151
本文介绍了运行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,前提是您具有

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆