code: def extract_into_tensor(a, t, x_shape):
      b, *_ = t.shape
      out = a.gather(-1, t)
      return out.reshape(b, *((1,) * (len(x_shape) - 1)))
  
imports: import math
  import numpy
  import torch
  import torch.nn
  from einops import repeat
  from ldm.util import instantiate_from_config
label_desc: Use image node_id 5 for calling a global function with example usage: extract_into_tensor(a, t, x_shape) and returns: out