Vulkan: fix NaN in tanh.comp

This commit is contained in:
Stéphane du Hamel 2024-12-08 17:39:57 +01:00
parent 43ed389a3f
commit 93bdbc656d

View file

@ -16,6 +16,6 @@ void main() {
if (i >= p.KX) {
return;
}
data_d[i] = D_TYPE(tanh(data_a[i]));
float th = tanh(data_a[i]);
data_d[i] = D_TYPE(th==th ? th : sign(data_a[i]));
}