class_docstr: PL Lightning Module for the CFLOW algorithm.
class_docstr_tok: ["PL","Lightning","Module","for","the","CFLOW","algorithm","."]
docstr: Validation Step of CFLOW.
  
      Similar to the training step, encoder features
      are extracted from the CNN for each batch, and anomaly
      map is computed.
  
  Args:
      batch (dict[str, str | Tensor]): Input batch
  
  Returns:
      Dictionary containing images, anomaly maps, true labels and masks.
      These are required in `validation_epoch_end` for feature concatenation.
docstr_tok: ["Validation","Step","of","CFLOW",".","Similar","to","the","training","step",",","encoder","features","are","extracted","from","the","CNN","for","each","batch",",","and","anomaly","map","is","computed",".","Args",":","batch","(","dict","[","str",",","str","|","Tensor","]",")",":","Input","batch","Returns",":","Dictionary","containing","images",",","anomaly","maps",",","true","labels","and","masks",".","These","are","required","in","`","validation_epoch_end","`","for","feature","concatenation","."]
code: def validation_step(
      self, batch: dict[str, str | Tensor], *args, **kwargs
  ) -> STEP_OUTPUT:
      """Validation Step of CFLOW.
  
          Similar to the training step, encoder features
          are extracted from the CNN for each batch, and anomaly
          map is computed.
  
      Args:
          batch (dict[str, str | Tensor]): Input batch
  
      Returns:
          Dictionary containing images, anomaly maps, true labels and masks.
          These are required in `validation_epoch_end` for feature concatenation.
  
      """
      del args, kwargs  # These variables are not used.
  
      batch["anomaly_maps"] = self.model(batch["image"])
      return batch
  
imports: from __future__ import annotations
  import einops
  import torch
  import torch.nn.functional
  from omegaconf import DictConfig, ListConfig
  from pytorch_lightning.callbacks import EarlyStopping
  from pytorch_lightning.utilities.types import STEP_OUTPUT
  from torch import Tensor, optim
  from torch.optim import Optimizer
  from anomalib.models.cflow.torch_model import CflowModel
  from anomalib.models.cflow.utils import get_logp, positional_encoding_2d
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 4 for calling the Cflow obj's underlying member method code with example usage: obj.validation_step(batch) and returns: batch