code: def sample_from_gaussian(y_hat, log_std_min=-7.0, scale_factor=1.0):
      assert y_hat.size(2) == 2
      mean = y_hat[:, :, :1]
      log_std = torch.clamp(y_hat[:, :, 1:], min=log_std_min)
      dist = Normal(
          mean,
          torch.exp(log_std),
      )
      sample = dist.sample()
      sample = torch.clamp(
          torch.clamp(sample, min=-scale_factor), max=scale_factor
      )
      del dist
      return sample
  
file_path: TTS/TTS/vocoder/utils/distribution.py
imports: import numpy
  import math
  import torch
  from torch.distributions.normal import Normal
  import torch.nn.functional
label_desc: Use image node_id 2 for calling a global function with example usage: sample_from_gaussian(y_hat, log_std_min, scale_factor) and returns: sample