Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[install] torch.complex32 has been removed from 1.11.0 #609

Merged
merged 1 commit into from
Mar 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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