code: def _weighted_variance(
      input, log_weights, dim=0, keepdim=False, unbiased=True
  ):
      # Ref: https://en.wikipedia.org/wiki/Weighted_arithmetic_mean#Frequency_weights
      deviation_squared = (
          input - _weighted_mean(input, log_weights, dim, keepdim=True)
      ).pow(2)
      correction = (
          log_weights.size(0) / (log_weights.size(0) - 1.0)
          if unbiased
          else 1.0
      )
      return (
          _weighted_mean(deviation_squared, log_weights, dim, keepdim)
          * correction
      )
  
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 13 for calling a global function with example usage: _weighted_variance(input, log_weights, dim, keepdim, unbiased) and returns: unknown