parameters: (self, inputs, state, scope=None)
return_statement: return m_out, state_out
docstring: Run one step of LSTM.
  
      Args:
        inputs: input Tensor, 2D, batch x num_units.
        state: state Tensor, 2D, batch x state_size.
        scope: VariableScope for the created subgraph; defaults to
          "TimeFreqLSTMCell".
  
      Returns:
        A tuple containing:
        - A 2D, batch x output_dim, Tensor representing the output of the LSTM
          after reading "inputs" when previous state was "state".
          Here output_dim is num_units.
        - A 2D, batch x state_size, Tensor representing the new state of LSTM
          after reading "inputs" when previous state was "state".
      Raises:
        ValueError: if an input_size was specified and the provided inputs have
          a different dimension.
docstring_summary: Run one step of LSTM.
docstring_tokens: Run one step of LSTM .
function: def __call__(self, inputs, state, scope=None):
      """Run one step of LSTM.
  
      Args:
        inputs: input Tensor, 2D, batch x num_units.
        state: state Tensor, 2D, batch x state_size.
        scope: VariableScope for the created subgraph; defaults to
          "TimeFreqLSTMCell".
  
      Returns:
        A tuple containing:
        - A 2D, batch x output_dim, Tensor representing the output of the LSTM
          after reading "inputs" when previous state was "state".
          Here output_dim is num_units.
        - A 2D, batch x state_size, Tensor representing the new state of LSTM
          after reading "inputs" when previous state was "state".
      Raises:
        ValueError: if an input_size was specified and the provided inputs have
          a different dimension.
      """
      sigmoid = math_ops.sigmoid
      tanh = math_ops.tanh
  
      freq_inputs = self._make_tf_features(inputs)
      dtype = inputs.dtype
      actual_input_size = freq_inputs[0].get_shape().as_list()[1]
      with vs.variable_scope(scope or type(self).__name__,
                             initializer=self._initializer):  # "TimeFreqLSTMCell"
        concat_w = _get_concat_variable(
            "W", [actual_input_size + 2*self._num_units, 4 * self._num_units],
            dtype, self._num_unit_shards)
        b = vs.get_variable(
            "B", shape=[4 * self._num_units],
            initializer=array_ops.zeros_initializer, dtype=dtype)
  
        # Diagonal connections
        if self._use_peepholes:
          w_f_diag = vs.get_variable(
              "W_F_diag", shape=[self._num_units], dtype=dtype)
          w_i_diag = vs.get_variable(
              "W_I_diag", shape=[self._num_units], dtype=dtype)
          w_o_diag = vs.get_variable(
              "W_O_diag", shape=[self._num_units], dtype=dtype)
  
        # initialize the first freq state to be zero
        m_prev_freq = array_ops.zeros([int(inputs.get_shape()[0]),
                                       self._num_units], dtype)
        for fq in range(len(freq_inputs)):
          c_prev = array_ops.slice(state, [0, 2*fq*self._num_units],
                                   [-1, self._num_units])
          m_prev = array_ops.slice(state, [0, (2*fq+1)*self._num_units],
                                   [-1, self._num_units])
          # i = input_gate, j = new_input, f = forget_gate, o = output_gate
          cell_inputs = array_ops.concat(1, [freq_inputs[fq], m_prev,
                                             m_prev_freq])
          lstm_matrix = nn_ops.bias_add(math_ops.matmul(cell_inputs, concat_w), b)
          i, j, f, o = array_ops.split(1, 4, lstm_matrix)
  
          if self._use_peepholes:
            c = (sigmoid(f + self._forget_bias + w_f_diag * c_prev) * c_prev +
                 sigmoid(i + w_i_diag * c_prev) * tanh(j))
          else:
            c = (sigmoid(f + self._forget_bias) * c_prev + sigmoid(i) * tanh(j))
  
          if self._cell_clip is not None:
            # pylint: disable=invalid-unary-operand-type
            c = clip_ops.clip_by_value(c, -self._cell_clip, self._cell_clip)
            # pylint: enable=invalid-unary-operand-type
  
          if self._use_peepholes:
            m = sigmoid(o + w_o_diag * c) * tanh(c)
          else:
            m = sigmoid(o) * tanh(c)
          m_prev_freq = m
          if fq == 0:
            state_out = array_ops.concat(1, [c, m])
            m_out = m
          else:
            state_out = array_ops.concat(1, [state_out, c, m])
            m_out = array_ops.concat(1, [m_out, m])
      return m_out, state_out
function_tokens: def __call__ ( self , inputs , state , scope = None ) : sigmoid = math_ops . sigmoid tanh = math_ops . tanh freq_inputs = self . _make_tf_features ( inputs ) dtype = inputs . dtype actual_input_size = freq_inputs [ 0 ] . get_shape ( ) . as_list ( ) [ 1 ] with vs . variable_scope ( scope or type ( self ) . __name__ , initializer = self . _initializer ) : # "TimeFreqLSTMCell" concat_w = _get_concat_variable ( "W" , [ actual_input_size + 2 * self . _num_units , 4 * self . _num_units ] , dtype , self . _num_unit_shards ) b = vs . get_variable ( "B" , shape = [ 4 * self . _num_units ] , initializer = array_ops . zeros_initializer , dtype = dtype ) # Diagonal connections if self . _use_peepholes : w_f_diag = vs . get_variable ( "W_F_diag" , shape = [ self . _num_units ] , dtype = dtype ) w_i_diag = vs . get_variable ( "W_I_diag" , shape = [ self . _num_units ] , dtype = dtype ) w_o_diag = vs . get_variable ( "W_O_diag" , shape = [ self . _num_units ] , dtype = dtype ) # initialize the first freq state to be zero m_prev_freq = array_ops . zeros ( [ int ( inputs . get_shape ( ) [ 0 ] ) , self . _num_units ] , dtype ) for fq in range ( len ( freq_inputs ) ) : c_prev = array_ops . slice ( state , [ 0 , 2 * fq * self . _num_units ] , [ - 1 , self . _num_units ] ) m_prev = array_ops . slice ( state , [ 0 , ( 2 * fq + 1 ) * self . _num_units ] , [ - 1 , self . _num_units ] ) # i = input_gate, j = new_input, f = forget_gate, o = output_gate cell_inputs = array_ops . concat ( 1 , [ freq_inputs [ fq ] , m_prev , m_prev_freq ] ) lstm_matrix = nn_ops . bias_add ( math_ops . matmul ( cell_inputs , concat_w ) , b ) i , j , f , o = array_ops . split ( 1 , 4 , lstm_matrix ) if self . _use_peepholes : c = ( sigmoid ( f + self . _forget_bias + w_f_diag * c_prev ) * c_prev + sigmoid ( i + w_i_diag * c_prev ) * tanh ( j ) ) else : c = ( sigmoid ( f + self . _forget_bias ) * c_prev + sigmoid ( i ) * tanh ( j ) ) if self . _cell_clip is not None : # pylint: disable=invalid-unary-operand-type c = clip_ops . clip_by_value ( c , - self . _cell_clip , self . _cell_clip ) # pylint: enable=invalid-unary-operand-type if self . _use_peepholes : m = sigmoid ( o + w_o_diag * c ) * tanh ( c ) else : m = sigmoid ( o ) * tanh ( c ) m_prev_freq = m if fq == 0 : state_out = array_ops . concat ( 1 , [ c , m ] ) m_out = m else : state_out = array_ops . concat ( 1 , [ state_out , c , m ] ) m_out = array_ops . concat ( 1 , [ m_out , m ] ) return m_out , state_out