Skip to content

Commit

Permalink
[install] torch.complex32 has been removed from 1.11.0
Browse files Browse the repository at this point in the history
According to pytorch/pytorch#72721 complex32
will be brought back in a later version, the check should be removed
then.
  • Loading branch information
ben-freist committed Mar 16, 2022
1 parent 25b03c7 commit 42d239d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions asteroid/dsp/beamforming.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,14 +473,6 @@ def _generalized_eigenvalue_decomposition(a, b):
return e_val, e_vec


_to_double_map = {
torch.float16: torch.float64,
torch.float32: torch.float64,
torch.complex32: torch.complex128,
torch.complex64: torch.complex128,
}


def _common_dtype(*args):
all_dtypes = [a.dtype for a in args]
if len(set(all_dtypes)) > 1:
Expand All @@ -502,20 +494,24 @@ def force_double_linalg():


def _precision_mapping():
has_complex32 = hasattr(torch, "complex32")
if USE_DOUBLE:
return {
precision_map = {
torch.float16: torch.float64,
torch.float32: torch.float64,
torch.complex32: torch.complex128,
torch.complex64: torch.complex128,
}
if has_complex32:
precision_map[torch.complex32] = torch.complex128
else:
return {
precision_map = {
torch.float16: torch.float16,
torch.float32: torch.float32,
torch.complex32: torch.complex32,
torch.complex64: torch.complex64,
}
if has_complex32:
precision_map[torch.complex32] = torch.complex32
return precision_map


# Legacy
Expand Down

0 comments on commit 42d239d

Please sign in to comment.