Skip to content

Commit

Permalink
fix: use dimension as a property
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiwowar committed Mar 5, 2024
1 parent 17936da commit 2eaaec5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xpmir/neural/interaction/colbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __validate__(self):

def __initialize__(self, options):
super().__initialize__(options)
self.linear = nn.Linear(self.encoder.dimension(), self.linear_dim, bias=False)
self.linear = nn.Linear(self.encoder.dimension, self.linear_dim, bias=False)

def _encode(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/xpmir/text/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def static(self):

@property
def dimension(self):
return self.encoder.dimension()
return self.encoder.dimension

def forward(self, texts: List[InputType], options=None) -> RepresentationOutput:
emb_texts = self.encoder(texts, options=options)
Expand Down
3 changes: 2 additions & 1 deletion src/xpmir/text/encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,6 @@ def static(self):
"""Whether embeddings parameters are learnable"""
return self.encoder.static()

@property
def dimension(self):
return self.encoder.dimension()
return self.encoder.dimension

0 comments on commit 2eaaec5

Please sign in to comment.