🎨 Format Python code with psf/black

This commit is contained in:
ndem0
2024-02-09 11:25:00 +00:00
committed by Nicola Demo
parent 591aeeb02b
commit cbb43a5392
64 changed files with 1323 additions and 955 deletions

View File

@@ -3,8 +3,9 @@ import torch
def check_point(x, current_stride, dim):
max_stride = current_stride + dim
indeces = torch.logical_and(x[..., :-1] < max_stride, x[..., :-1]
>= current_stride).all(dim=-1)
indeces = torch.logical_and(
x[..., :-1] < max_stride, x[..., :-1] >= current_stride
).all(dim=-1)
return indeces
@@ -32,12 +33,12 @@ def optimizing(f):
def wrapper(*args, **kwargs):
if kwargs['type'] == 'forward':
if kwargs["type"] == "forward":
if not wrapper.has_run_inverse:
wrapper.has_run_inverse = True
return f(*args, **kwargs)
if kwargs['type'] == 'inverse':
if kwargs["type"] == "inverse":
if not wrapper.has_run:
wrapper.has_run = True
return f(*args, **kwargs)