class_docstr: The ``VISSLAdapter`` is an :class:`~flash.core.adapter.Adapter` for integrating with VISSL.
  
  Also inherits from ``AdaptVISSLHooks`` to support VISSL hooks.
class_docstr_tok: ["The","``","VISSLAdapter","``","is","an",":","class",":","`","~flash.core.adapter.Adapter","`","for","integrating","with","VISSL",".","Also","inherits","from","``","AdaptVISSLHooks","``","to","support","VISSL","hooks","."]
code: def __init__(
      self,
      backbone: nn.Module,
      head: nn.Module,
      loss_fn: ClassyLoss,
      hooks: List[ClassyHook],
  ) -> None:
      Adapter.__init__(self)
  
      self.model_config = self.get_model_config_template()
      self.optimizer_config = AttrDict({})
  
      self.backbone = backbone
      self.head = [head] if not isinstance(head, list) else head
      self.loss_fn = loss_fn
      self.hooks = hooks
  
      self.model_config.TRUNK = self.backbone.model_config.TRUNK
      self.model_config.HEAD = self.head[0].model_config.HEAD
      self.task_config = AttrDict(
          {
              "MODEL": self.model_config,
              "OPTIMIZER": self.optimizer_config,
              "LOSS": AttrDict(
                  {
                      "name": self.loss_fn.loss_name,
                      self.loss_fn.loss_name: self.loss_fn.loss_config,
                  }
              ),
          }
      )
  
      self.vissl_base_model = BaseSSLMultiInputOutputModel(
          self.model_config, self.optimizer_config
      )
      # patch backbone and head
      self.vissl_base_model.trunk = backbone
      self.vissl_base_model.heads = nn.ModuleList(self.head)
  
      self.vissl_task = MockVISSLTask(
          self, self.loss_fn, self.task_config, self.vissl_base_model
      )
  
      AdaptVISSLHooks.__init__(self, hooks=hooks, task=self.vissl_task)
  
imports: from typing import Any, List, Union
  import torch
  import torch.nn
  from flash.core.adapter import Adapter
  from flash.core.data.io.input import DataKeys
  from flash.core.model import Task
  from flash.core.utilities.imports import _VISSL_AVAILABLE
  from flash.core.utilities.stability import beta
  from flash.image.embedding.vissl.hooks import AdaptVISSLHooks
label_desc: Use image node_id 1 to create a new VISSLAdapter object from inherited base classes: Adapter, AdaptVISSLHooks with example: obj = VISSLAdapter(backbone, head, loss_fn, hooks)