class_docstr: Abstract class for kernels used in the :class:`SVGD` inference algorithm.
docstr: Compute the component kernels and their gradients.
  
  :param particles: a tensor with shape (N, D)
  :returns: A pair (`log_kernel`, `kernel_grad`) where `log_kernel` is a (N, N, D)-shaped
      tensor equal to the logarithm of the kernel and `kernel_grad` is a (N, N, D)-shaped
      tensor where the entry (n, m, d) represents the derivative of `log_kernel` w.r.t.
      x_{m,d}, where x_{m,d} is the d^th dimension of particle m.
docstr_tok: ["Compute","the","component","kernels","and","their","gradients",".",":","param","particles",":","a","tensor","with","shape","(","N",",","D",")",":","returns",":","A","pair","(","`","log_kernel","`",",","`","kernel_grad","`",")","where","`","log_kernel","`","is","a","(","N",",","N",",","D",")","-shaped","tensor","equal","to","the","logarithm","of","the","kernel","and","`","kernel_grad","`","is","a","(","N",",","N",",","D",")","-shaped","tensor","where","the","entry","(","n",",","m",",","d",")","represents","the","derivative","of","`","log_kernel","`","w.r.t",".","x_","{","m",",","d","}",",","where","x_","{","m",",","d","}","is","the","d^th","dimension","of","particle","m","."]
code: def log_kernel_and_grad(self, particles):
      """
      Compute the component kernels and their gradients.
  
      :param particles: a tensor with shape (N, D)
      :returns: A pair (`log_kernel`, `kernel_grad`) where `log_kernel` is a (N, N, D)-shaped
          tensor equal to the logarithm of the kernel and `kernel_grad` is a (N, N, D)-shaped
          tensor where the entry (n, m, d) represents the derivative of `log_kernel` w.r.t.
          x_{m,d}, where x_{m,d} is the d^th dimension of particle m.
      """
      raise NotImplementedError
  
imports: import math
  from abc import ABCMeta, abstractmethod
  import torch
  from torch.distributions import biject_to
  import pyro
  from pyro import poutine
  from pyro.distributions import Delta
  from pyro.distributions.util import copy_docs_from
  from pyro.infer.autoguide.guides import AutoContinuous
  from pyro.infer.autoguide.initialization import init_to_sample
  from pyro.infer.trace_elbo import Trace_ELBO
label_desc: Use image node_id 1 for calling the SteinKernel obj's underlying member method code with example usage: obj.log_kernel_and_grad(particles) without return types