class_docstr: Compute energy of each frame. The energy computed for each frame then is normalized so that the values would
  represent energy per `ref_duration`. I.e., if `frame_length` > `sample_rate * ref_duration`,
  
  Args:
      sample_rate (int): sample rate of the audio
      ref_duration (float): reference duration for normalization
      frame_length (int): length of a frame that is used in computing energy
      hop_length (int): hop length aka frame rate. time resolution of the energy computation.
      pad_end (bool): whether to pad at the end of the signal of there would be a otherwise-discarded partial frame
      pad_value (int or float): value to use in the padding
      data_format (str): `channels_first`, `channels_last`, or `default`
      **kwargs: optional keyword args for `tf.keras.layers.Layer()`
  
  Example:
      ::
  
          input_shape = (2048, 1)  # mono signal
          model = Sequential()
          model.add(kapre.Energy(frame_length=1024, hop_length=512, input_shape=input_shape))
          # now the shape is (batch, n_frame=3, ch=1)
docstr: Args:
      x (`Tensor`): batch audio signal in the specified 1D format in initiation.
  
  Returns:
      (`Tensor`): A framed tensor. The shape is (batch, time (frames), channel) if `channels_last`, or
      (batch, channel, time (frames)) if `channels_first`.
docstr_tok: ["Args",":","x","(","`","Tensor","`",")",":","batch","audio","signal","in","the","specified","1D","format","in","initiation",".","Returns",":","(","`","Tensor","`",")",":","A","framed","tensor",".","The","shape","is","(","batch",",","time","(","frames",")",",","channel",")","if","`","channels_last","`",",","or","(","batch",",","channel",",","time","(","frames",")",")","if","`","channels_first","`","."]
code: def call(self, x):
      """
      Args:
          x (`Tensor`): batch audio signal in the specified 1D format in initiation.
  
      Returns:
          (`Tensor`): A framed tensor. The shape is (batch, time (frames), channel) if `channels_last`, or
          (batch, channel, time (frames)) if `channels_first`.
      """
      frames = tf.signal.frame(
          x,
          frame_length=self.frame_length,
          frame_step=self.hop_length,
          pad_end=self.pad_end,
          pad_value=self.pad_value,
          axis=self.time_axis,
      )
      frames = tf.math.square(frames)  # batch, ndim=4
  
      frame_axis = 2 if self.data_format == _CH_LAST_STR else 3
      energies = tf.math.reduce_sum(
          frames, axis=frame_axis
      )  # batch, ndim=3. (b, t, ch) or (b, ch, t)
  
      # normalize it to self.ref_duration
      nor_coeff = self.ref_duration / (
          self.frame_length / self.sample_rate
      )
  
      return nor_coeff * energies
  
imports: import tensorflow
  from tensorflow.keras.layers import Layer
  from tensorflow.keras import backend
  from .None import backend
  from .backend import _CH_FIRST_STR, _CH_LAST_STR, _CH_DEFAULT_STR
label_desc: Use image node_id 2 for calling the Energy obj's underlying member method code with example usage: obj.call(x) and returns: unknown