class_docstr: TrainEvalModel.
  This module allows to wrap together a common feature extractor and
  two classifiers: one used during training time and another
  used at test time. The classifier is switched depending on the
  `training` state of the module.
class_docstr_tok: ["TrainEvalModel",".","This","module","allows","to","wrap","together","a","common","feature","extractor","and","two","classifiers",":","one","used","during","training","time","and","another","used","at","test","time",".","The","classifier","is","switched","depending","on","the","`","training","`","state","of","the","module","."]
code: def forward(self, x):
      x = self.feature_extractor(x)
      if self.training:
          return self.train_classifier(x)
      else:
          return self.eval_classifier(x)
  
imports: import torch
  from torch.nn import Module
  from typing import Optional
  from avalanche.benchmarks.utils.flat_data import ConstantSequence
  from avalanche.benchmarks.scenarios import CLExperience
label_desc: Use image node_id 2 for calling the TrainEvalModel obj's underlying member method code with example usage: obj.forward(x) and returns: self, self