class_docstr: Learning to Prompt (L2P) strategy.
  
  Technique introduced in:
  "Wang, Zifeng, et al. "Learning to prompt for continual learning."
  Proceedings of the IEEE/CVF Conference on Computer Vision and
  Pattern Recognition. 2022."
  
  Implementation based on:
  - https://github.com/JH-LEE-KR/l2p-pytorch
  - And implementations by Dario Salvati
  
  As a model_name, we expect to receive one of the model list in
  avalanche.models.vit
  
  Those models are based on the library timm.
class_docstr_tok: ["Learning","to","Prompt","(","L2P",")","strategy",".","Technique","introduced","in",":","''","Wang",",","Zifeng",",","et","al",".","``","Learning","to","prompt","for","continual","learning",".","''","Proceedings","of","the","IEEE\/CVF","Conference","on","Computer","Vision","and","Pattern","Recognition",".","2022",".","''","Implementation","based","on",":","-","https",":","\/\/github.com\/JH-LEE-KR\/l2p-pytorch","-","And","implementations","by","Dario","Salvati","As","a","model_name",",","we","expect","to","receive","one","of","the","model","list","in","avalanche.models.vit","Those","models","are","based","on","the","library","timm","."]
code: def forward(self):
      assert self.experience is not None
      if self.use_cls_features:
          with torch.no_grad():
              cls_features = self.original_vit(self.mb_x)["pre_logits"]
      else:
          cls_features = None
  
      if self.use_vit:
          self.res = self.model(
              x=self.mb_x,
              task_id=self.mb_task_id,
              cls_features=cls_features,
              train=self.train_prompt_mask,
          )
      else:
          self.res = {}
          self.res["logits"] = self.model(x=self.mb_x)
          self.res["reduce_sim"] = 0
  
      logits = self.res["logits"]
  
      if self.use_mask and self.is_training:
          mask = self.experience.classes_in_this_experience
          not_mask = np.setdiff1d(np.arange(self.num_classes), mask)
          not_mask = torch.tensor(not_mask, dtype=torch.int64).to(
              self.device
          )
          logits = logits.index_fill(
              dim=1, index=not_mask, value=float("-inf")
          )
  
      return logits
  
file_path: avalanche/avalanche/training/supervised/l2p.py
imports: from typing import Callable, List, Optional, Union
  import numpy
  import torch
  import torch.nn
  from avalanche.training.plugins import EvaluationPlugin
  from avalanche.training.plugins.strategy_plugin import SupervisedPlugin
  from avalanche.training.plugins.evaluation import default_evaluator
  from avalanche.training.templates import SupervisedTemplate
  from avalanche.models.vit import create_model
label_desc: Use image node_id 3 for calling the LearningToPrompt obj's underlying member method code with example usage: obj.forward() and returns: logits