From ba92903fc568e2a599ffbaeb8dfecb7b766c64e2 Mon Sep 17 00:00:00 2001 From: John Wang Date: Wed, 17 Jan 2024 19:59:10 +0000 Subject: [PATCH] Andrew's mulmodal stuff --- whobpyt/models/EEG/ParamsEEG.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/whobpyt/models/EEG/ParamsEEG.py b/whobpyt/models/EEG/ParamsEEG.py index fe80b1e1..51b29e31 100644 --- a/whobpyt/models/EEG/ParamsEEG.py +++ b/whobpyt/models/EEG/ParamsEEG.py @@ -9,4 +9,13 @@ def __init__(self, Lead_Field): ############################################# self.LF = Lead_Field # This should be [num_regions, num_channels] + + def to(self, device): + # Moves all parameters between CPU and GPU + + vars_names = [a for a in dir(self) if not a.startswith('__')] + for var_name in vars_names: + var = getattr(self, var_name) + if (type(var) == par): + var.to(device) \ No newline at end of file