Skip to content

Commit

Permalink
🎨 Format Python code with psf/black
Browse files Browse the repository at this point in the history
  • Loading branch information
ndem0 committed Aug 27, 2024
1 parent 68f5521 commit 59fc197
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pina/model/layers/orthogonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def forward(self, X):
)

result = torch.zeros_like(X)

# normalize first basis
X_0 = torch.select(X, self.dim, 0)
result_0 = torch.select(result, self.dim, 0)
result_0 += X_0 / torch.norm(X_0)

# iterate over the rest of the basis with Gram-Schmidt
for i in range(1, X.shape[self.dim]):
v = torch.select(X, self.dim, i)
Expand All @@ -54,5 +54,5 @@ def forward(self, X):
) * torch.select(result, self.dim, j)
result_i = torch.select(result, self.dim, i)
result_i += v / torch.norm(v)

return result

0 comments on commit 59fc197

Please sign in to comment.