code: def plot_tsne(z_loc, classes, name):
      import matplotlib
  
      matplotlib.use("Agg")
      import matplotlib.pyplot as plt
      import numpy as np
      from sklearn.manifold import TSNE
  
      model_tsne = TSNE(n_components=2, random_state=0)
      z_states = z_loc.detach().cpu().numpy()
      z_embed = model_tsne.fit_transform(z_states)
      classes = classes.detach().cpu().numpy()
      fig = plt.figure()
      for ic in range(10):
          ind_vec = np.zeros_like(classes)
          ind_vec[:, ic] = 1
          ind_class = classes[:, ic] == 1
          color = plt.cm.Set1(ic)
          plt.scatter(
              z_embed[ind_class, 0],
              z_embed[ind_class, 1],
              s=10,
              color=color,
          )
          plt.title("Latent Variable T-SNE per Class")
          fig.savefig(
              "./vae_results/"
              + str(name)
              + "_embedding_"
              + str(ic)
              + ".png"
          )
      fig.savefig("./vae_results/" + str(name) + "_embedding.png")
  
imports: import torch
label_desc: Use image node_id 6 for calling a global function with example usage: plot_tsne(z_loc, classes, name) without return types