class_docstr: Distribution over spanning trees on a fixed number ``V`` of vertices.
  
  A tree is represented as :class:`torch.LongTensor` ``edges`` of shape
  ``(V-1,2)`` satisfying the following properties:
  
  1. The edges constitute a tree, i.e. are connected and cycle free.
  2. Each edge ``(v1,v2) = edges[e]`` is sorted, i.e. ``v1 < v2``.
  3. The entire tensor is sorted in colexicographic order.
  
  Use :func:`validate_edges` to verify `edges` are correctly formed.
  
  The ``edge_logits`` tensor has one entry for each of the ``V*(V-1)//2``
  edges in the complete graph on ``V`` vertices, where edges are each sorted
  and the edge order is colexicographic::
  
      (0,1), (0,2), (1,2), (0,3), (1,3), (2,3), (0,4), (1,4), (2,4), ...
  
  This ordering corresponds to the size-independent pairing function::
  
      k = v1 + v2 * (v2 - 1) // 2
  
  where ``k`` is the rank of the edge ``(v1,v2)`` in the complete graph.
  To convert a matrix of edge logits to the linear representation used here::
  
      assert my_matrix.shape == (V, V)
      i, j = make_complete_graph(V)
      edge_logits = my_matrix[i, j]
  
  :param torch.Tensor edge_logits: A tensor of length ``V*(V-1)//2``
      containing logits (aka negative energies) of all edges in the complete
      graph on ``V`` vertices. See above comment for edge ordering.
  :param dict sampler_options: An optional dict of sampler options including:
      ``mcmc_steps`` defaulting to a single MCMC step (which is pretty good);
      ``initial_edges`` defaulting to a cheap approximate sample;
      ``backend`` one of "python" or "cpp", defaulting to "python".
docstr: Computes marginal probabilities of each edge being active.
  
  .. note:: This is similar to other distributions' ``.mean()``
      method, but with a different shape because this distribution's
      values are not encoded as binary matrices.
  
  :returns: A symmetric square ``(V,V)``-shaped matrix with values
      in ``[0,1]`` denoting the marginal probability of each edge
      being in a sampled value.
  :rtype: Tensor
docstr_tok: ["Computes","marginal","probabilities","of","each","edge","being","active",".","..","note",":",":","This","is","similar","to","other","distributions","'","``",".mean","(",")","``","method",",","but","with","a","different","shape","because","this","distribution's","values","are","not","encoded","as","binary","matrices",".",":","returns",":","A","symmetric","square","``","(","V",",","V",")","``","-shaped","matrix","with","values","in","``","[","0,1","]","``","denoting","the","marginal","probability","of","each","edge","being","in","a","sampled","value",".",":","rtype",":","Tensor"]
code: def edge_mean(self):
      """
      Computes marginal probabilities of each edge being active.
  
      .. note:: This is similar to other distributions' ``.mean()``
          method, but with a different shape because this distribution's
          values are not encoded as binary matrices.
  
      :returns: A symmetric square ``(V,V)``-shaped matrix with values
          in ``[0,1]`` denoting the marginal probability of each edge
          being in a sampled value.
      :rtype: Tensor
      """
      V = self.num_vertices
      v1, v2 = make_complete_graph(V).unbind(0)
      logits = self.edge_logits - self.edge_logits.max()
      w = self.edge_logits.new_zeros(V, V)
      w[v1, v2] = w[v2, v1] = logits.exp()
      laplacian = w.sum(-1).diag_embed() - w
      inv = (laplacian + 1 / V).pinverse()
      resistance = inv.diag() + inv.diag()[..., None] - 2 * inv
      return resistance * w
  
imports: import itertools
  import math
  import torch
  from torch.distributions import constraints
  from torch.distributions.utils import lazy_property
  from pyro.distributions.torch_distribution import TorchDistribution
label_desc: Use image node_id 8 for calling the SpanningTree obj's underlying member method code with example usage: obj.edge_mean() and returns: unknown