code: def to_one_hot(tensor, n, fill_with=1.0):
      # we perform one hot encore with respect to the last axis
      one_hot = torch.FloatTensor(tensor.size() + (n,)).zero_()
      if tensor.is_cuda:
          one_hot = one_hot.cuda()
      one_hot.scatter_(
          len(tensor.size()), tensor.unsqueeze(-1), fill_with
      )
      return one_hot
  
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 6 for calling a global function with example usage: to_one_hot(tensor, n, fill_with) and returns: one_hot