运行Tensorflow单元测试

编程入门 行业动态 更新时间:2024-10-23 13:24:40
本文介绍了运行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单元测试

本文发布于:2023-10-31 04:12:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544967.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单元测试   Tensorflow

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!