Skip to content

Commit

Permalink
Fix typing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanCrabbe committed Nov 30, 2023
1 parent b04c75e commit b05668b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ repos:
rev: v0.991
hooks:
- id: mypy
args: [
args:
[
"--ignore-missing-imports",
"--scripts-are-modules",
"--disallow-incomplete-defs",
Expand All @@ -35,5 +36,5 @@ repos:
"--disallow-untyped-calls",
"--install-types",
"--non-interactive",
"--follow-imports=skip", # This is temporary until the mbi directory is not excluded
"--follow-imports=skip",
]
5 changes: 5 additions & 0 deletions src/fdiff/utils/fourier.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,9 @@ def idft(x: torch.Tensor) -> torch.Tensor:
# Apply IFFT
x_time = irfft(x_freq, dim=1, norm="ortho")

assert isinstance(x_time, torch.Tensor)
assert (
x_time.size() == x.size()
), f"The inverse DFT and the input should have the same size. Got {x_time.size()} and {x.size()} instead."

return x_time

0 comments on commit b05668b

Please sign in to comment.