class_docstr: CFA: Coupled-hypersphere-based Feature Adaptation for Target-Oriented Anomaly Localization.
  
  Args:
      input_size (tuple[int, int]): Size of the model input.
      backbone (str): Backbone CNN network
      gamma_c (int, optional): gamma_c value from the paper. Defaults to 1.
      gamma_d (int, optional): gamma_d value from the paper. Defaults to 1.
      num_nearest_neighbors (int): Number of nearest neighbors.
      num_hard_negative_features (int): Number of hard negative features.
      radius (float): Radius of the hypersphere to search the soft boundary.
class_docstr_tok: ["CFA",":","Coupled-hypersphere-based","Feature","Adaptation","for","Target-Oriented","Anomaly","Localization",".","Args",":","input_size","(","tuple","[","int",",","int","]",")",":","Size","of","the","model","input",".","backbone","(","str",")",":","Backbone","CNN","network","gamma_c","(","int",",","optional",")",":","gamma_c","value","from","the","paper",".","Defaults","to","1.","gamma_d","(","int",",","optional",")",":","gamma_d","value","from","the","paper",".","Defaults","to","1.","num_nearest_neighbors","(","int",")",":","Number","of","nearest","neighbors",".","num_hard_negative_features","(","int",")",":","Number","of","hard","negative","features",".","radius","(","float",")",":","Radius","of","the","hypersphere","to","search","the","soft","boundary","."]
docstr: Backward step for the CFA model.
  
  Args:
      loss (Tensor): Loss value.
      optimizer (Optimizer | None): Optimizer.
      optimizer_idx (int | None): Optimizer index.
docstr_tok: ["Backward","step","for","the","CFA","model",".","Args",":","loss","(","Tensor",")",":","Loss","value",".","optimizer","(","Optimizer","|","None",")",":","Optimizer",".","optimizer_idx","(","int","|","None",")",":","Optimizer","index","."]
code: def backward(
      self,
      loss: Tensor,
      optimizer: Optimizer | None,
      optimizer_idx: int | None,
      *args,
      **kwargs,
  ) -> None:
      """Backward step for the CFA model.
  
      Args:
          loss (Tensor): Loss value.
          optimizer (Optimizer | None): Optimizer.
          optimizer_idx (int | None): Optimizer index.
      """
      del (
          optimizer,
          optimizer_idx,
          args,
          kwargs,
      )  # These variables are not used.
  
      # TODO: Investigate why retain_graph is needed.
      loss.backward(retain_graph=True)
  
imports: from __future__ import annotations
  import logging
  import torch
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning import Callback
  from pytorch_lightning.callbacks import EarlyStopping
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor
  from torch.optim.optimizer import Optimizer
  from anomalib.models.cfa.loss import CfaLoss
  from anomalib.models.cfa.torch_model import CfaModel
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 5 for calling the Cfa obj's underlying member method code with example usage: obj.backward(loss, optimizer, optimizer_idx) without return types