Use check_version function in.
@@ -11,7 +11,7 @@ import warnings
import numpy as np
import torch
-import skorch
+from mne.utils.check import check_version
from skorch.callbacks.scoring import EpochScoring
from skorch.utils import to_numpy
from skorch.dataset import unpack_data
@@ -355,7 +355,7 @@ class PostEpochTrainScoring(EpochScoring):
for batch in iterator:
batch_X, batch_y = unpack_data(batch)
# TODO: remove after skorch 0.10 release
- if skorch.__version__.split('.')[1] == '9':
+ if not check_version('skorch', min_version='0.10.1'):
yp = net.evaluation_step(batch_X, training=False)
# X, y unpacking has been pushed downstream in skorch 0.10
else:
