class_docstr: F0 estimation with dio + stonemask algorithm.
  
  This is f0 extractor based on dio + stonmask algorithm introduced in `WORLD:
  a vocoder-based high-quality speech synthesis system for real-time applications`_.
  
  .. _`WORLD: a vocoder-based high-quality speech synthesis system for real-time
      applications`: https://doi.org/10.1587/transinf.2015EDP7457
  
  Note:
      This module is based on NumPy implementation. Therefore, the computational graph
      is not connected.
  
  Todo:
      Replace this module with PyTorch-based implementation.
class_docstr_tok: ["F0","estimation","with","dio","+","stonemask","algorithm",".","This","is","f0","extractor","based","on","dio","+","stonmask","algorithm","introduced","in","`","WORLD",":","a","vocoder-based","high-quality","speech","synthesis","system","for","real-time","applications","`","_",".","..","_","`","WORLD",":","a","vocoder-based","high-quality","speech","synthesis","system","for","real-time","applications","`",":","https",":","\/\/doi.org\/10.1587\/transinf.2015EDP7457","Note",":","This","module","is","based","on","NumPy","implementation",".","Therefore",",","the","computational","graph","is","not","connected",".","Todo",":","Replace","this","module","with","PyTorch-based","implementation","."]
code: def _calculate_f0(self, input: torch.Tensor) -> torch.Tensor:
      x = input.cpu().numpy().astype(np.double)
      f0, timeaxis = pyworld.dio(
          x,
          self.fs,
          f0_floor=self.f0min,
          f0_ceil=self.f0max,
          frame_period=self.frame_period,
      )
      f0 = pyworld.stonemask(x, f0, timeaxis, self.fs)
      if self.use_continuous_f0:
          f0 = self._convert_to_continuous_f0(f0)
      if self.use_log_f0:
          nonzero_idxs = np.where(f0 != 0)[0]
          f0[nonzero_idxs] = np.log(f0[nonzero_idxs])
      return input.new_tensor(f0.reshape(-1), dtype=torch.float)
  
imports: import logging
  from typing import Any, Dict, Tuple, Union
  import humanfriendly
  import numpy
  import pyworld
  import torch
  import torch.nn.functional
  from scipy.interpolate import interp1d
  from typeguard import check_argument_types
  from espnet2.tts.feats_extract.abs_feats_extract import AbsFeatsExtract
  from espnet.nets.pytorch_backend.nets_utils import pad_list
label_desc: Use image node_id 5 for calling the Dio obj's underlying member method code with example usage: obj._calculate_f0(input) and returns: input