class_docstr: A builder class that allows to builds a multitrack unet model
  estimator. The built model estimator has a different behaviour when
  used in a train/eval mode and in predict mode.
  
  * In train/eval mode:
      It takes as input and outputs magnitude spectrogram
  * In predict mode:
      It takes as input and outputs waveform.
      The whole separation process is then done in this function
      for performance reason: it makes it possible to run the whole
      separation process (including STFT and inverse STFT) on GPU.
  
  Example:
  >>> from spleeter.model import EstimatorSpecBuilder
  >>> builder = EstimatorSpecBuilder()
  >>> builder.build_predict_model()
  >>> builder.build_evaluation_model()
  >>> builder.build_train_model()
  
  >>> from spleeter.model import model_fn
  >>> estimator = tf.estimator.Estimator(model_fn=model_fn, ...)
class_docstr_tok: ["A","builder","class","that","allows","to","builds","a","multitrack","unet","model","estimator",".","The","built","model","estimator","has","a","different","behaviour","when","used","in","a","train\/eval","mode","and","in","predict","mode",".","*","In","train\/eval","mode",":","It","takes","as","input","and","outputs","magnitude","spectrogram","*","In","predict","mode",":","It","takes","as","input","and","outputs","waveform",".","The","whole","separation","process","is","then","done","in","this","function","for","performance","reason",":","it","makes","it","possible","to","run","the","whole","separation","process","(","including","STFT","and","inverse","STFT",")","on","GPU",".","Example",":",">",">",">","from","spleeter.model","import","EstimatorSpecBuilder",">",">",">","builder","=","EstimatorSpecBuilder","(",")",">",">",">","builder.build_predict_model","(",")",">",">",">","builder.build_evaluation_model","(",")",">",">",">","builder.build_train_model","(",")",">",">",">","from","spleeter.model","import","model_fn",">",">",">","estimator","=","tf.estimator.Estimator","(","model_fn=model_fn",",","...",")"]
docstr: Compute STFT of waveform and slice the STFT in segment
  with the right length to feed the network.
docstr_tok: ["Compute","STFT","of","waveform","and","slice","the","STFT","in","segment","with","the","right","length","to","feed","the","network","."]
code: def _build_stft_feature(self):
      """
      Compute STFT of waveform and slice the STFT in segment
      with the right length to feed the network.
      """
      stft_name = self.stft_name
      spec_name = self.spectrogram_name
  
      if stft_name not in self._features:
          # pad input with a frame of zeros
          waveform = tf.concat(
              [
                  tf.zeros((self._frame_length, self._n_channels)),
                  self._features["waveform"],
              ],
              0,
          )
          stft_feature = tf.transpose(
              stft(
                  tf.transpose(waveform),
                  self._frame_length,
                  self._frame_step,
                  window_fn=lambda frame_length, dtype: (
                      hann_window(
                          frame_length, periodic=True, dtype=dtype
                      )
                  ),
                  pad_end=True,
              ),
              perm=[1, 2, 0],
          )
          self._features[f"{self._mix_name}_stft"] = stft_feature
      if spec_name not in self._features:
          self._features[spec_name] = tf.abs(
              pad_and_partition(self._features[stft_name], self._T)
          )[:, :, : self._F, :]
  
imports: import importlib
  from typing import Any, Dict, Optional, Tuple
  import tensorflow
  from tensorflow.signal import hann_window, inverse_stft, stft
  from ..utils.tensor import pad_and_partition, pad_and_reshape
label_desc: Use image node_id 8 for calling the EstimatorSpecBuilder obj's underlying member method code with example usage: obj._build_stft_feature() without return types