Skip to content

Commit

Permalink
device none if layer is not module
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Nov 12, 2024
1 parent d3d2096 commit 0ec0b1e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mttl/models/containers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def __init__(self, config, layer, selector=None):
self._enabled = True
self.config = config
self.layer = layer
self.device = next(layer.parameters()).device
if isinstance(layer, nn.Module):
self.device = next(layer.parameters()).device
else:
self.device = None
self.selector = selector or TaskNameSelector()
self._default_expert_name = None
self.expert_infos = {}
Expand Down

0 comments on commit 0ec0b1e

Please sign in to comment.