Skip to content
Snippets Groups Projects
Commit a2f363f8 authored by André Pedersen's avatar André Pedersen
Browse files

Added top_k check in class __init__

parent 7a5dfc6c
No related branches found
Tags v0.3.6
No related merge requests found
...@@ -37,6 +37,8 @@ class HybridRouteLayer: ...@@ -37,6 +37,8 @@ class HybridRouteLayer:
self.alpha = alpha self.alpha = alpha
self.top_k = top_k self.top_k = top_k
if self.top_k < 1:
raise ValueError(f"top_k needs to be >= 1, but was: {self.top_k}.")
self.routes = routes self.routes = routes
if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr( if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(
self.sparse_encoder, "fit" self.sparse_encoder, "fit"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment