Tensorflow中有许多方法可以clear_devices
设备。例如session_bundle.exporter.Exporter:init
、import_meta_graph
、export_meta_graph
和python.training.saver.Saver.export_meta_graph'。文档指出:
clear_devices: Whether or not to clear the device field for an `Operation` or `Tensor` during export.
但不要真正澄清剥离这些信息的含义。
从图形中剥离设备信息意味着,如果不添加新的设备放置指令,操作将按默认值放置。如果导出/导入的图形将在不同的设置中执行,或者馈送到它的数据将不同(例如,在 GPU 上训练后在 CPU 上以小批量大小提供服务(,这可能很有用。