code: def _test_time_embeddings():
      """
      Test sinusoidal time step embeddings
      """
      import matplotlib.pyplot as plt
  
      plt.figure(figsize=(15, 5))
      m = UNetModel(
          in_channels=1,
          out_channels=1,
          channels=320,
          n_res_blocks=1,
          attention_levels=[],
          channel_multipliers=[],
          n_heads=1,
          tf_layers=1,
          d_cond=1,
      )
      te = m.time_step_embedding(torch.arange(0, 1000))
      plt.plot(np.arange(1000), te[:, [50, 100, 190, 260]].numpy())
      plt.legend(["dim %d" % p for p in [50, 100, 190, 260]])
      plt.title("Time embeddings")
      plt.show()
  
imports: import math
  from typing import List
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from labml_nn.diffusion.stable_diffusion.model.unet_attention import SpatialTransformer
label_desc: Use image node_id 2 for calling a global function with example usage: _test_time_embeddings() without return types