class_docstr: This is a base class for Metrics neural networks
  (only applicable for Riemannian based VAE)
class_docstr_tok: ["This","is","a","base","class","for","Metrics","neural","networks","(","only","applicable","for","Riemannian","based","VAE",")"]
docstr: This function must be implemented in a child class.
  It takes the input data and returns an instance of
  :class:`~pythae.models.base.base_utils.ModelOutput`.
  If you decide to provide your own metric network, you must make sure your
  model inherit from this class by setting and then defining your forward function as
  such:
  
  .. code-block::
  
      >>> from pythae.models.nn import BaseMetric
      >>> from pythae.models.base.base_utils import ModelOutput
      ...
      >>> class My_Metric(BaseMetric):
      ...
      ...    def __init__(self):
      ...        BaseMetric.__init__(self)
      ...        # your code
      ...
      ...    def forward(self, x: torch.Tensor):
      ...        # your code
      ...        output = ModelOutput(
      ...             L=L # L matrices in the metric of  Riemannian based VAE (see docs)
      ...         )
      ...        return output
  
  Parameters:
      x (torch.Tensor): The input data that must be encoded
  
  Returns:
      output (~pythae.models.base.base_utils.ModelOutput): The output of the metric
docstr_tok: ["This","function","must","be","implemented","in","a","child","class",".","It","takes","the","input","data","and","returns","an","instance","of",":","class",":","`","~pythae.models.base.base_utils.ModelOutput","`",".","If","you","decide","to","provide","your","own","metric","network",",","you","must","make","sure","your","model","inherit","from","this","class","by","setting","and","then","defining","your","forward","function","as","such",":","..","code-block",":",":",">",">",">","from","pythae.models.nn","import","BaseMetric",">",">",">","from","pythae.models.base.base_utils","import","ModelOutput","...",">",">",">","class","My_Metric","(","BaseMetric",")",":","...","...","def","__init__","(","self",")",":","...","BaseMetric.__init__","(","self",")","...","#","your","code","...","...","def","forward","(","self",",","x",":","torch.Tensor",")",":","...","#","your","code","...","output","=","ModelOutput","(","...","L=L","#","L","matrices","in","the","metric","of","Riemannian","based","VAE","(","see","docs",")","...",")","...","return","output","Parameters",":","x","(","torch.Tensor",")",":","The","input","data","that","must","be","encoded","Returns",":","output","(","~pythae.models.base.base_utils.ModelOutput",")",":","The","output","of","the","metric"]
code: def forward(self, x):
      r"""This function must be implemented in a child class.
      It takes the input data and returns an instance of
      :class:`~pythae.models.base.base_utils.ModelOutput`.
      If you decide to provide your own metric network, you must make sure your
      model inherit from this class by setting and then defining your forward function as
      such:
  
      .. code-block::
  
          >>> from pythae.models.nn import BaseMetric
          >>> from pythae.models.base.base_utils import ModelOutput
          ...
          >>> class My_Metric(BaseMetric):
          ...
          ...    def __init__(self):
          ...        BaseMetric.__init__(self)
          ...        # your code
          ...
          ...    def forward(self, x: torch.Tensor):
          ...        # your code
          ...        output = ModelOutput(
          ...             L=L # L matrices in the metric of  Riemannian based VAE (see docs)
          ...         )
          ...        return output
  
      Parameters:
          x (torch.Tensor): The input data that must be encoded
  
      Returns:
          output (~pythae.models.base.base_utils.ModelOutput): The output of the metric
      """
      raise NotImplementedError()
  
file_path: benchmark_VAE/src/pythae/models/nn/base_architectures.py
imports: import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the BaseMetric obj's underlying member method code with example usage: obj.forward(x) without return types