teamtomo / torch-fourier-shell-correlation

Calculate the Fourier shell correlation in PyTorch
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

coerce to same dtype and warn if images are not the same dtype #4

Open alisterburt opened 2 months ago

alisterburt commented 2 months ago

This implementation doesn't handle when a and b are of different types

    def _normalised_cc_complex_1d(a: torch.Tensor, b: torch.Tensor):
>       correlation = torch.dot(a, torch.conj(b))
E       RuntimeError: dot : expected both vectors to have same dtype, but found ComplexDouble and ComplexFloat

ideally this would be smart and aware of relative precisions of difference types but doesn't matter in the first instance

@sjrothfuss or @milesagraham maybe you'd like to take this on? no pressure of course, just let me know if you're planning to work on it

sjrothfuss commented 2 months ago

I'm interested in helping but realistically couldn't take this on until at least mid September.