Skip to content

Commit

Permalink
Moved linear dictionary to bottom for ordering
Browse files Browse the repository at this point in the history
This allows dictionary to see classes.
  • Loading branch information
gkielian committed Apr 9, 2024
1 parent c7fff41 commit 5290cd4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions variations/linear_variations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
import torch.nn as nn
import math

linear_dictionary = {
"linear": nn.Linear(),
"bitlinear": BitLinear(),
"bitlinear_optimized": BitLinearOptimized(),
}


class BitLinear(nn.Linear):
"""PyTorch BitLinear Layer
Expand Down Expand Up @@ -175,3 +169,10 @@ def forward(self, input):
output = self.quantize_activations_groupwise(output)

return output


linear_dictionary = {
"linear": nn.Linear,
"bitlinear": BitLinear,
"bitlinear_optimized": BitLinearOptimized,
}

0 comments on commit 5290cd4

Please sign in to comment.