You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
std::vector<float> random_data(num_ele);
for (size_t i = 0; i < num_ele; i++) {
random_data[i] = static_cast<float>(dist(engine)); // All random data
}
我在开发gather算子时遇到了一个bug,经过排查发现很有可能是因为SetRandData 的功能跟我认为的功能不太一样。
源码中将随机到的整数转为浮点数再对浮点张量进行赋值
在其他类似工具生成随机数的时候通常是用Randint,randn,rand等函数名确定实际生成的随机数分布,数据类型通过额外指定,所以SetRandData函数是否也应该采用类似的写法,比如SetRandint,SetRandn这种,T指定了针对的张量数据类型。
我感觉这样至少有两点好处
相关 pr:#897
The text was updated successfully, but these errors were encountered: