class_docstr: A wrapper class used for the calculation of different information measures.
  
  This metric can be used to measure the information between the discrete reference distributions of predicted and
  reference sentences. The class also handles input validation for `alpha` and `beta` parameters.
  
  Args:
      information_measure:
          A name of information measure to be used. Please use one of: ['kl_divergence', 'alpha_divergence',
          'beta_divergence', 'ab_divergence', 'renyi_divergence', 'l1_distance', 'l2_distance', 'l_infinity_distance',
          'fisher_rao_distance']
      alpha:
          Alpha parameter of the divergence used for alpha, AB and Rényi divergence measures.
      beta:
          Beta parameter of the divergence used for beta and AB divergence measures.
  
  Raises:
      ValueError:
          If information measure is one from alpha, AB or Rényi divergence and parameter `alpha` is `None`.
      ValueError:
          If information measure is one from beta or divergence and parameter `beta` is `None`.
      ValueError:
          If information measure is alpha divergence and parameter `alpha` equals 0 or 1.
      ValueError:
          If information measure is beta divergence and parameter `beta` equals 0 or -1.
      ValueError:
          If information measure is AB divergence and parameter `alpha`, `beta` or `alpha + beta` equal 0.
      ValueError:
          If information measure is Rényi divergence and parameter `alpha` equals 1.
class_docstr_tok: ["A","wrapper","class","used","for","the","calculation","of","different","information","measures",".","This","metric","can","be","used","to","measure","the","information","between","the","discrete","reference","distributions","of","predicted","and","reference","sentences",".","The","class","also","handles","input","validation","for","`","alpha","`","and","`","beta","`","parameters",".","Args",":","information_measure",":","A","name","of","information","measure","to","be","used",".","Please","use","one","of",":","[","'kl_divergence","'",",","'alpha_divergence","'",",","'beta_divergence","'",",","'ab_divergence","'",",","'renyi_divergence","'",",","'l1_distance","'",",","'l2_distance","'",",","'l_infinity_distance","'",",","'fisher_rao_distance","'","]","alpha",":","Alpha","parameter","of","the","divergence","used","for","alpha",",","AB","and","R\u00e9nyi","divergence","measures",".","beta",":","Beta","parameter","of","the","divergence","used","for","beta","and","AB","divergence","measures",".","Raises",":","ValueError",":","If","information","measure","is","one","from","alpha",",","AB","or","R\u00e9nyi","divergence","and","parameter","`","alpha","`","is","`","None","`",".","ValueError",":","If","information","measure","is","one","from","beta","or","divergence","and","parameter","`","beta","`","is","`","None","`",".","ValueError",":","If","information","measure","is","alpha","divergence","and","parameter","`","alpha","`","equals","0","or","1",".","ValueError",":","If","information","measure","is","beta","divergence","and","parameter","`","beta","`","equals","0","or","-1",".","ValueError",":","If","information","measure","is","AB","divergence","and","parameter","`","alpha","`",",","`","beta","`","or","`","alpha","+","beta","`","equal","0",".","ValueError",":","If","information","measure","is","R\u00e9nyi","divergence","and","parameter","`","alpha","`","equals","1","."]
docstr: Calculate L2 distance between discrete distributions of predicted and reference sentences.
  
  Args:
      preds_distribution:
          Discrete reference distribution of predicted sentences over the vocabulary.
      target_distribution:
          Discrete reference distribution of reference sentences over the vocabulary.
  
  Return:
      L2 distance between discrete distributions of predicted and reference sentences.
docstr_tok: ["Calculate","L2","distance","between","discrete","distributions","of","predicted","and","reference","sentences",".","Args",":","preds_distribution",":","Discrete","reference","distribution","of","predicted","sentences","over","the","vocabulary",".","target_distribution",":","Discrete","reference","distribution","of","reference","sentences","over","the","vocabulary",".","Return",":","L2","distance","between","discrete","distributions","of","predicted","and","reference","sentences","."]
code: def _calculate_l2_distance(
      preds_distribution: Tensor, target_distribution: Tensor
  ) -> Tensor:
      """Calculate L2 distance between discrete distributions of predicted and reference sentences.
  
      Args:
          preds_distribution:
              Discrete reference distribution of predicted sentences over the vocabulary.
          target_distribution:
              Discrete reference distribution of reference sentences over the vocabulary.
  
      Return:
          L2 distance between discrete distributions of predicted and reference sentences.
  
      """
      return torch.norm(
          target_distribution - preds_distribution, p=2, dim=-1
      )
  
imports: import os
  from enum import unique
  from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import functional
  from torch.utils.data import DataLoader
  from typing_extensions import Literal
  from torchmetrics.functional.text.helper_embedding_metric import TokenizedDataset, _get_progress_bar, _input_data_collator, _load_tokenizer_and_model
  from torchmetrics.utilities.enums import EnumStr
  from torchmetrics.utilities.imports import _TRANSFORMERS_GREATER_EQUAL_4_4
label_desc: Use image node_id 9 for calling the _InformationMeasure obj's underlying member method code with example usage: obj._calculate_l2_distance(preds_distribution, target_distribution) and returns: torch