Skip to content

Commit

Permalink
Simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
jloveric committed Jun 15, 2024
1 parent 6d4278c commit 0b6177a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions high_order_layers_torch/Basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def __call__(self, x):

# These are the outputs, but they need to be in a sparse tensor
# so they work with everything, do dense for now.
out = self._expand(x_in)
out = self._expand(x_in).permute(1, 2, 3, 4, 0)

mat = torch.zeros(
x.shape[0],
Expand All @@ -279,8 +279,6 @@ def __call__(self, x):
# This needs to be
windex = torch.div(torch.arange(wrange.numel()), self._n, rounding_mode="floor")

out = out.permute(1, 2, 3, 4, 0)

mat_trans = mat.reshape(-1, self._variables)
mat_trans[windex, wrange.view(-1)] = out.flatten()
mat = mat_trans.reshape(
Expand Down

0 comments on commit 0b6177a

Please sign in to comment.