Skip to content

Commit 7c5dccc

Browse files
authored
[fix] setup_device to class method
1 parent 6021315 commit 7c5dccc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Scheduler/scheduler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class PyTorchSimRunner:
144144
PARTITION_BUSY = 0
145145
PARTITION_IDLE = 1
146146
SELECT_NOTHING = 2
147+
_npu_module = None
147148
def __init__(self, tog_simulator : TOGSimulator, num_partion=1) -> None:
148149
self.module = self.setup_device()
149150
self.num_partion = num_partion
@@ -161,7 +162,7 @@ def __init__(self, tog_simulator : TOGSimulator, num_partion=1) -> None:
161162
# Dry run for compile and create generator
162163
os.environ["TOGSIM_EAGER_MODE"] = "1"
163164

164-
@staticmethod
165+
@classmethod
165166
def setup_device():
166167
if cls._npu_module is not None:
167168
return cls._npu_module

0 commit comments

Comments
 (0)