class_docstr: Planar Flow model.
  
  Args:
      model_config (PlanarFlowConfig): The PlanarFlow model configuration setting the main parameters of
          the model.
docstr: The input data is transformed toward the prior
  
  Args:
      inputs (torch.Tensor): An input tensor
  
  Returns:
      ModelOutput: An instance of ModelOutput containing all the relevant parameters
docstr_tok: ["The","input","data","is","transformed","toward","the","prior","Args",":","inputs","(","torch.Tensor",")",":","An","input","tensor","Returns",":","ModelOutput",":","An","instance","of","ModelOutput","containing","all","the","relevant","parameters"]
code: def forward(self, x: torch.Tensor, **kwargs) -> ModelOutput:
      """The input data is transformed toward the prior
  
      Args:
          inputs (torch.Tensor): An input tensor
  
      Returns:
          ModelOutput: An instance of ModelOutput containing all the relevant parameters
      """
      x = x.reshape(x.shape[0], -1)
      lin = x @ self.w.T + self.b  # [B x 1]
      f = x + self.u * self.activation(lin)  # [B x input_dim]
      phi = self.activation_derivative(lin) @ self.w  # [B x input_dim]
      log_det = torch.log(
          torch.abs(1 + phi @ self.u.T) + 1e-4
      ).squeeze()  # [B]
  
      output = ModelOutput(out=f, log_abs_det_jac=log_det)
  
      return output
  
file_path: benchmark_VAE/src/pythae/models/normalizing_flows/planar_flow/planar_flow_model.py
imports: import os
  import torch
  import torch.nn
  import torch.nn.functional
  from ...base.base_utils import ModelOutput
  from ..base import BaseNF
  from .planar_flow_config import PlanarFlowConfig
label_desc: Use image node_id 2 for calling the PlanarFlow obj's underlying member method code with example usage: obj.forward(x) and returns: output