LibtorchTutorials icon indicating copy to clipboard operation
LibtorchTutorials copied to clipboard

传递Torch::Device 类型参数报错

Open JohnHerry opened this issue 2 years ago • 1 comments

你好, 请教一下,Torch::Device对象可以作为函数形参吗? 我们封装模型推理器时,怎么让调用者可以动态指定计算设备?

JohnHerry avatar Feb 21 '22 09:02 JohnHerry

@JohnHerry 可以作为对象传参啊,不行字符串都行,自己写好映射函数

AllentDan avatar Feb 22 '22 01:02 AllentDan