code: def _compute_chain_variance_stats(input):
      # compute within-chain variance and variance estimator
      # input has shape N x C x sample_shape
      N = input.size(0)
      chain_var = input.var(dim=0)
      var_within = chain_var.mean(dim=0)
      var_estimator = (N - 1) / N * var_within
      if input.size(1) > 1:
          chain_mean = input.mean(dim=0)
          var_between = chain_mean.var(dim=0)
          var_estimator = var_estimator + var_between
      else:
          # to make rho_k is the same as autocorrelation when num_chains == 1
          # in computing effective_sample_size
          var_within = var_estimator
      return var_within, var_estimator
  
imports: import math
  import numbers
  import torch
  from torch.fft import irfft, rfft
  from .tensor_utils import next_fast_len
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_chain_variance_stats(input) and returns: var_within,  var_estimator