class_docstr: :param model: probabilistic model defined as a function
  :param guide: guide used for sampling defined as a function
  :param num_samples: number of samples to draw from the guide (default 10)
  
  This method performs posterior inference by importance sampling
  using the guide as the proposal distribution.
  If no guide is provided, it defaults to proposing from the model's prior.
class_docstr_tok: [":","param","model",":","probabilistic","model","defined","as","a","function",":","param","guide",":","guide","used","for","sampling","defined","as","a","function",":","param","num_samples",":","number","of","samples","to","draw","from","the","guide","(","default","10",")","This","method","performs","posterior","inference","by","importance","sampling","using","the","guide","as","the","proposal","distribution",".","If","no","guide","is","provided",",","it","defaults","to","proposing","from","the","model","'s","prior","."]
docstr: Compute the normalized importance weights.
docstr_tok: ["Compute","the","normalized","importance","weights","."]
code: def get_normalized_weights(self, log_scale=False):
      """
      Compute the normalized importance weights.
      """
      if self.log_weights:
          log_w = torch.tensor(self.log_weights)
          log_w_norm = log_w - torch.logsumexp(log_w, 0)
          return log_w_norm if log_scale else torch.exp(log_w_norm)
      else:
          warnings.warn(
              "The log_weights list is empty. There is nothing to normalize."
          )
  
file_path: pyro/pyro/infer/importance.py
imports: import math
  import warnings
  import torch
  import pyro
  import pyro.poutine
  from pyro.ops.stats import fit_generalized_pareto
  from .abstract_infer import TracePosterior
  from .enum import get_importance_trace
label_desc: Use image node_id 4 for calling the Importance obj's underlying member method code with example usage: obj.get_normalized_weights(log_scale) and returns: unknown