tensorflow - TensorFlow XLA 是否已弃用?
问题描述
我刚刚读到(这里):
在此版本中弃用 XLA_CPU 和 XLA_GPU 设备。(TF 2.2.0)
XLA 现在被弃用了吗?它不再使用了吗?有替代方案吗?还是这一切都是在内部自动处理的?这种弃用是什么意思?
解决方案
不,XLA 并没有被弃用,事实上还有其他关于它的发行说明:
- XLA
- XLA 现在可以在 Windows 上构建和工作。所有预构建的软件包都带有可用的 XLA。
- XLA 可以在 CPU 和 GPU 上启用“编译或抛出异常”语义。
tf.function
该注释实际上与您提到的弃用有关。不推荐使用的是使用字符串XLA_CPU
和XLA_GPU
with tf.device
。请参阅弃用警告消息:
XLA_GPU and XLA_CPU devices are deprecated and will be
removed in subsequent releases. Instead, use either
@tf.function(experimental_compile=True) for must-compile
semantics, or run with TF_XLA_FLAGS=--tf_xla_auto_jit=2
for auto-clustering best-effort compilation.
这就是另一个发行说明所讨论的内容,在 XLA 指南中使用 tf.function 显式编译下提到了这一点。
推荐阅读
- mysql - 具有多个 SELECT 和 GROUP BY 的 MySQL
- python - 是否可以控制笔记本电脑摄像头闪烁?开启和关闭?
- javascript - 连接到 websocket 时如何添加标头?
- google-chrome - Blink 内存缓存存储什么?
- excel - 如何使用 Excel VBA 检查访问表中是否存在字段?
- python - Python-Sqlite3:试图导出字符串。问题:包含“\N\n”
- python - 无法在kivy中打开窗口
- sql - SQL Order By with case when
- javascript - 删除被禁止用户的消息?
- python - 如何将 C 函数编译为 numpy ufunc 并动态加载?