code: def sampler(model, sampler_config):
      # simulates learned metric
      model.centroids_tens = torch.randn(20, model.latent_dim)
      model.M_tens = torch.randn(20, model.latent_dim, model.latent_dim)
      return RHVAESampler(model=model, sampler_config=sampler_config)
  
file_path: benchmark_VAE/tests/test_rhvae_sampler.py
imports: import os
  import numpy
  import pytest
  import torch
  from pythae.models import RHVAE, RHVAEConfig
  from pythae.pipelines import GenerationPipeline
  from pythae.samplers import NormalSampler, NormalSamplerConfig, RHVAESampler, RHVAESamplerConfig
label_desc: Use image node_id 4 for calling a global function with example usage: sampler(model, sampler_config) and returns: RHVAESampler