praeclarum / webgpu-torch

Tensor computation with WebGPU acceleration
MIT License
576 stars 15 forks source link

pow(2) fails for 2x3 tensors on GPU #11

Closed praeclarum closed 1 year ago

praeclarum commented 1 year ago

NaNs show up in the result.

praeclarum commented 1 year ago

Turns out WebGPU pow does not handle negative inputs even when the exponent is an integer.

Put in special logic to detect this: https://github.com/praeclarum/webgpu-torch/commit/0f1c13c564af9c8b0d07c329f0f55d16c629d511