为什么每次我们需要在 TensorFlow 中 运行 某些东西时构建 bazel?
Why build bazel everytime we need to run something in TensorFlow?
我已经通过 bazel build 从源代码安装了 TensorFlow。一切都按预期正常工作。但是当我在自述文件 https://github.com/tensorflow/models/tree/master/research/slim 中阅读教程时,它提到了为每个脚本构建 bazel,我假设 bazel 正在构建它之前构建的大量资源。
是否有构建所有 TensorFlow 源的脚本?
it's mentioned to bazel build for each script and I assume bazel is building a lot of sources which it has previouxly built.
Bazel 缓存以前构建的构建输出,并且仅构建尚不可用的内容,或者自上次构建以来可能发生变化的内容。
如果你 bazel build //foo:a
,那么,在不更改源代码树中的任何内容的情况下,你构建 bazel build //bar:b
,那么无论 //foo:a
和 //bar:b
都依赖什么,Bazel 都会不会在第二次构建中再次构建。
这是否回答了您的问题?
Is there a script to build all TensorFlow sources?
您可以告诉 Bazel 在给定路径下构建所有内容,例如bazel build //foo/bar/...
,构建 //foo/bar
及其所有子包中的所有内容。在这种情况下,您希望在工作区中构建所有内容,因此您需要 运行:
bazel build //...
我已经通过 bazel build 从源代码安装了 TensorFlow。一切都按预期正常工作。但是当我在自述文件 https://github.com/tensorflow/models/tree/master/research/slim 中阅读教程时,它提到了为每个脚本构建 bazel,我假设 bazel 正在构建它之前构建的大量资源。
是否有构建所有 TensorFlow 源的脚本?
it's mentioned to bazel build for each script and I assume bazel is building a lot of sources which it has previouxly built.
Bazel 缓存以前构建的构建输出,并且仅构建尚不可用的内容,或者自上次构建以来可能发生变化的内容。
如果你 bazel build //foo:a
,那么,在不更改源代码树中的任何内容的情况下,你构建 bazel build //bar:b
,那么无论 //foo:a
和 //bar:b
都依赖什么,Bazel 都会不会在第二次构建中再次构建。
这是否回答了您的问题?
Is there a script to build all TensorFlow sources?
您可以告诉 Bazel 在给定路径下构建所有内容,例如bazel build //foo/bar/...
,构建 //foo/bar
及其所有子包中的所有内容。在这种情况下,您希望在工作区中构建所有内容,因此您需要 运行:
bazel build //...