在 TensorFlow 中添加新设备 [英] Add a new device in TensorFlow

查看:39
本文介绍了在 TensorFlow 中添加新设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 TensorFlow 中,Session 将图形操作置于 Devices 上,例如 CPUGPU,并提供了执行它们的方法.是否可以向 TensorFlow 添加一类额外的设备?除了CPU和GPU,我们还叫它XPU?

In TensorFlow, a Session places the graph ops onto Devices, such as CPUs or GPUs, and provides methods to execute them. Is it possible to add an additional class of devices to TensorFlow? Let's call it XPU in addition to CPU and GPU?

推荐答案

虽然我们没有很好的文档,但可以向 TensorFlow 添加新的设备类型.大约,它需要添加 的新实现tensorflow::Device,添加tensorflow::DeviceFactory,并调用以下注册宏:

It is possible to add new device types to TensorFlow, although we don't have great documentation. Approximately, it would require adding a new implementation of tensorflow::Device, adding a corresponding implementation of tensorflow::DeviceFactory, and invoking the following registration macro:

REGISTER_LOCAL_DEVICE_FACTORY("XPU", MyXPUDeviceFactory);

这篇关于在 TensorFlow 中添加新设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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