从宿主指针进行构造时,是否自动推断类型

Does array fire constructor automatically deduce type when constructing from host pointer?

本文关键字:是否 类型 指针 宿主      更新时间:2023-10-16

我从array fire的文档中读到可以从宿主指针构造一个array fire数组。就像

double * host_data;
//do stuff with host_data
af::array array(nrows, ncols, host_data); //suppose is a nrows by  ncols array

然而,我现在还不清楚数组火灾是否会自动决定数组的类型为"double"(f64)而不是默认的float(f32)。

非常感谢您的帮助

是的,宿主指针用于推断数组的类型。这就是为什么这个特定的构造函数没有显式传递类型的参数。

相关文章: