class_docstr: UHiFiGAN generator module.
class_docstr_tok: ["UHiFiGAN","generator","module","."]
docstr: Register stats for de-normalization as buffer.
  
  Args:
      stats (str): Path of statistics file (".npy" or ".h5").
docstr_tok: ["Register","stats","for","de-normalization","as","buffer",".","Args",":","stats","(","str",")",":","Path","of","statistics","file","(","``",".npy","''","or","``",".h5","''",")","."]
code: def register_stats(self, stats):
      """Register stats for de-normalization as buffer.
  
      Args:
          stats (str): Path of statistics file (".npy" or ".h5").
  
      """
      assert stats.endswith(".h5") or stats.endswith(".npy")
      if stats.endswith(".h5"):
          mean = read_hdf5(stats, "mean").reshape(-1)
          scale = read_hdf5(stats, "scale").reshape(-1)
      else:
          mean = np.load(stats)[0].reshape(-1)
          scale = np.load(stats)[1].reshape(-1)
      self.register_buffer("mean", torch.from_numpy(mean).float())
      self.register_buffer("scale", torch.from_numpy(scale).float())
      logging.info("Successfully registered stats as buffer.")
  
file_path: espnet/espnet2/gan_svs/uhifigan/uhifigan.py
imports: import logging
  from typing import List, Optional
  import numpy
  import torch
  import torch.nn.functional
label_desc: Use image node_id 6 for calling the UHiFiGANGenerator obj's underlying member method code with example usage: obj.register_stats(stats) without return types