Skip to content

Commit

Permalink
fix: wrong captured variable in lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyolicoris authored Aug 19, 2024
1 parent 4f27963 commit ed8ff06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torchcomp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def limiter_gain(
assert torch.all(at > 0) and torch.all(at < 1)
assert torch.all(rt > 0) and torch.all(rt < 1)

factory_func = lambda x: torch.as_tensor(
x, device=x.device, dtype=x.dtype
factory_func = lambda h: torch.as_tensor(
h, device=x.device, dtype=x.dtype
).broadcast_to(x.shape[0])
threshold = factory_func(threshold)
at = factory_func(at)
Expand Down

0 comments on commit ed8ff06

Please sign in to comment.