kosiokarchev / phytorch

Utilities for physics with PyTorch
GNU General Public License v3.0
6 stars 2 forks source link

`std::isnan(c10::complex<T>)` name clash with torch #13

Open kosiokarchev opened 1 year ago

kosiokarchev commented 1 year ago

(related to pytorch/pytorch#107864)

Our existing definition of std::isnan(c10::complex<T>) now clashes with torch's (since v2.0.1). Since theirs doesn't have __device__, it can't be compiled on the GPU, and we can't (?) overwrite it.

A solution on our side is to... move all our functions to our namespace instead of std... or something less drastic.

It may be easier to just add C10_HOST_DEVICE to the isnan definition in c10/util/complex_utils.h, which is a quick hack solution for phytorch users who have write access to the torch headers.