docstr: See https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298
  
  Args:
      timesteps (`torch.Tensor`):
          generate embedding vectors at these timesteps
      embedding_dim (`int`, *optional*, defaults to 512):
          dimension of the embeddings to generate
      dtype:
          data type of the generated embeddings
  
  Returns:
      `torch.FloatTensor`: Embedding vectors with shape `(len(timesteps), embedding_dim)`
docstr_tok: ["See","https",":","\/\/github.com\/google-research\/vdm\/blob\/dc27b98a554f65cdc654b800da5aa1846545d41b\/model_vdm.py","#","L298","Args",":","timesteps","(","`","torch.Tensor","`",")",":","generate","embedding","vectors","at","these","timesteps","embedding_dim","(","`","int","`",",","*","optional","*",",","defaults","to","512",")",":","dimension","of","the","embeddings","to","generate","dtype",":","data","type","of","the","generated","embeddings","Returns",":","`","torch.FloatTensor","`",":","Embedding","vectors","with","shape","`","(","len","(","timesteps",")",",","embedding_dim",")","`"]
code: def get_guidance_scale_embedding(
      self, w, embedding_dim=512, dtype=None
  ):
      """
      See https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298
  
      Args:
          timesteps (`torch.Tensor`):
              generate embedding vectors at these timesteps
          embedding_dim (`int`, *optional*, defaults to 512):
              dimension of the embeddings to generate
          dtype:
              data type of the generated embeddings
  
      Returns:
          `torch.FloatTensor`: Embedding vectors with shape `(len(timesteps), embedding_dim)`
      """
      w = w * 1000
      half_dim = embedding_dim // 2
      emb = np.log(10000.0) / (half_dim - 1)
      emb = np.exp(np.arange(half_dim, dtype=dtype) * -emb)
      emb = w[:, None] * emb[None, :]
      emb = np.concatenate([np.sin(emb), np.cos(emb)], axis=1)
  
      if embedding_dim % 2 == 1:  # zero pad
          emb = np.pad(emb, [(0, 0), (0, 1)])
  
      assert emb.shape == (w.shape[0], embedding_dim)
      return emb
  
file_path: optimum/optimum/pipelines/diffusers/pipeline_latent_consistency.py
imports: import logging
  from typing import Callable, List, Optional, Union
  import numpy
  import torch
  from diffusers.pipelines.stable_diffusion import StableDiffusionPipelineOutput
  from .pipeline_stable_diffusion import StableDiffusionPipelineMixin
label_desc: Use image node_id 2 for calling the LatentConsistencyPipelineMixin obj's underlying member method code with example usage: obj.get_guidance_scale_embedding(w, embedding_dim, dtype) and returns: emb