class_docstr: Ring of sum-product operations in linear space.
  
  Tensor dimensions are packed; to read the name of a tensor, read the
  ``._pyro_dims`` attribute, which is a string of dimension names aligned
  with the tensor's shape.
class_docstr_tok: ["Ring","of","sum-product","operations","in","linear","space",".","Tensor","dimensions","are","packed",";","to","read","the","name","of","a","tensor",",","read","the","``","._pyro_dims","``","attribute",",","which","is","a","string","of","dimension","names","aligned","with","the","tensor","'s","shape","."]
code: def __init__(self, cache=None, dim_to_size=None):
      super().__init__(cache=cache)
      self._dim_to_size = {} if dim_to_size is None else dim_to_size
  
imports: import weakref
  from abc import ABCMeta, abstractmethod
  import torch
  from pyro.ops.einsum import contract
  from pyro.ops.einsum.adjoint import SAMPLE_SYMBOL, Backward
  from pyro.util import ignore_jit_warnings
label_desc: Use image node_id 1 to create a new LinearRing object from inherited base classes: Ring with example: obj = LinearRing(cache, dim_to_size)