code: def test_planar_flow_training_pipeline(
      self, planar_flow, prior, train_dataset, training_configs
  ):
      dir_path = training_configs.output_dir
  
      nf_model = NFModel(prior=prior, flow=planar_flow)
  
      # build pipeline
      pipeline = TrainingPipeline(
          model=nf_model, training_config=training_configs
      )
  
      assert (
          pipeline.training_config.__dict__ == training_configs.__dict__
      )
  
      # Launch Pipeline
      pipeline(
          train_data=train_dataset.data,  # gives tensor to pipeline
          eval_data=train_dataset.data,  # gives tensor to pipeline
      )
  
      model = deepcopy(pipeline.trainer._best_model.flow)
  
      training_dir = os.path.join(
          dir_path,
          f"PlanarFlow_training_{pipeline.trainer._training_signature}",
      )
      assert os.path.isdir(training_dir)
  
      final_dir = os.path.join(training_dir, f"final_model")
      assert os.path.isdir(final_dir)
  
      files_list = os.listdir(final_dir)
  
      assert set(
          ["model.pt", "model_config.json", "training_config.json"]
      ).issubset(set(files_list))
  
      # check reload full model
      model_rec = AutoModel.load_from_folder(os.path.join(final_dir))
  
      assert all(
          [
              torch.equal(
                  model_rec.state_dict()[key].cpu(),
                  model.state_dict()[key].cpu(),
              )
              for key in model.state_dict().keys()
          ]
      )
  
imports: import os
  from copy import deepcopy
  import numpy
  import pytest
  import torch
  from pydantic import ValidationError
  from pythae.data.datasets import BaseDataset
  from pythae.models import AutoModel
  from pythae.models.base.base_utils import ModelOutput
  from pythae.models.normalizing_flows import NFModel, PlanarFlow, PlanarFlowConfig
  from pythae.pipelines import TrainingPipeline
  from pythae.trainers import BaseTrainer, BaseTrainerConfig
label_desc: Use image node_id 13 for calling the Test_PlanarFlow_Training obj's underlying member method code with example usage: obj.test_planar_flow_training_pipeline(planar_flow, prior, train_dataset, training_configs) without return types