Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent f489ab8 commit 42654ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions test/test_grad/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
device = None


def gradchecker(
dtype: torch.dtype, name: str
) -> tuple[
def gradchecker(dtype: torch.dtype, name: str) -> tuple[
Callable[[Tensor, Tensor, Tensor, Tensor], Tensor], # autograd function
tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor],
]:
Expand Down Expand Up @@ -103,9 +101,7 @@ def test_gradgradcheck_slow(dtype: torch.dtype, name: str) -> None:
assert dgradgradcheck(func, diffvars, atol=1e-5, rtol=1e-5, fast_mode=False)


def gradchecker_batch(
dtype: torch.dtype, name1: str, name2: str
) -> tuple[
def gradchecker_batch(dtype: torch.dtype, name1: str, name2: str) -> tuple[
Callable[[Tensor, Tensor, Tensor, Tensor], Tensor], # autograd function
tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor],
]:
Expand Down
8 changes: 2 additions & 6 deletions test/test_grad/test_pos.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
tol = 1e-8


def gradchecker(
dtype: torch.dtype, name: str
) -> tuple[
def gradchecker(dtype: torch.dtype, name: str) -> tuple[
Callable[[Tensor], Tensor], # autograd function
Tensor, # differentiable variables
]:
Expand Down Expand Up @@ -91,9 +89,7 @@ def test_gradgradcheck(dtype: torch.dtype, name: str) -> None:
assert dgradgradcheck(func, diffvars, atol=tol)


def gradchecker_batch(
dtype: torch.dtype, name1: str, name2: str
) -> tuple[
def gradchecker_batch(dtype: torch.dtype, name1: str, name2: str) -> tuple[
Callable[[Tensor], Tensor], # autograd function
Tensor, # differentiable variables
]:
Expand Down

0 comments on commit 42654ce

Please sign in to comment.