parameters: (self, inputs, state)
return_statement: return new_h, new_state
docstring: Phased LSTM Cell.
  
      Args:
        inputs: A tuple of 2 Tensor.
           The first Tensor has shape [batch, 1], and type float32 or float64.
           It stores the time.
           The second Tensor has shape [batch, features_size], and type float32.
           It stores the features.
        state: rnn_cell_impl.LSTMStateTuple, state from previous timestep.
  
      Returns:
        A tuple containing:
        - A Tensor of float32, and shape [batch_size, num_units], representing the
          output of the cell.
        - A rnn_cell_impl.LSTMStateTuple, containing 2 Tensors of float32, shape
          [batch_size, num_units], representing the new state and the output.
docstring_summary: Phased LSTM Cell.
docstring_tokens: Phased LSTM Cell .
function: def call(self, inputs, state):
      """Phased LSTM Cell.
  
      Args:
        inputs: A tuple of 2 Tensor.
           The first Tensor has shape [batch, 1], and type float32 or float64.
           It stores the time.
           The second Tensor has shape [batch, features_size], and type float32.
           It stores the features.
        state: rnn_cell_impl.LSTMStateTuple, state from previous timestep.
  
      Returns:
        A tuple containing:
        - A Tensor of float32, and shape [batch_size, num_units], representing the
          output of the cell.
        - A rnn_cell_impl.LSTMStateTuple, containing 2 Tensors of float32, shape
          [batch_size, num_units], representing the new state and the output.
      """
      (c_prev, h_prev) = state
      (time, x) = inputs
  
      in_mask_gates = [x, h_prev]
      if self._use_peepholes:
        in_mask_gates.append(c_prev)
  
      with vs.variable_scope("mask_gates"):
        if self._linear1 is None:
          self._linear1 = _Linear(in_mask_gates, 2 * self._num_units, True)
  
        mask_gates = math_ops.sigmoid(
            self._linear1(in_mask_gates))
        [input_gate, forget_gate] = array_ops.split(
            axis=1, num_or_size_splits=2, value=mask_gates)
  
      with vs.variable_scope("new_input"):
        if self._linear2 is None:
          self._linear2 = _Linear([x, h_prev], self._num_units, True)
        new_input = math_ops.tanh(self._linear2([x, h_prev]))
  
      new_c = (c_prev * forget_gate + input_gate * new_input)
  
      in_out_gate = [x, h_prev]
      if self._use_peepholes:
        in_out_gate.append(new_c)
  
      with vs.variable_scope("output_gate"):
        if self._linear3 is None:
          self._linear3 = _Linear(in_out_gate, self._num_units, True)
        output_gate = math_ops.sigmoid(self._linear3(in_out_gate))
  
      new_h = math_ops.tanh(new_c) * output_gate
  
      period = vs.get_variable(
          "period", [self._num_units],
          initializer=_random_exp_initializer(
              self._period_init_min, self._period_init_max))
      phase = vs.get_variable(
          "phase", [self._num_units],
          initializer=init_ops.random_uniform_initializer(
              0., period.initial_value))
      ratio_on = vs.get_variable(
          "ratio_on", [self._num_units],
          initializer=init_ops.constant_initializer(self._ratio_on),
          trainable=self._trainable_ratio_on)
  
      cycle_ratio = self._get_cycle_ratio(time, phase, period)
  
      k_up = 2 * cycle_ratio / ratio_on
      k_down = 2 - k_up
      k_closed = self._leak * cycle_ratio
  
      k = array_ops.where(cycle_ratio < ratio_on, k_down, k_closed)
      k = array_ops.where(cycle_ratio < 0.5 * ratio_on, k_up, k)
  
      new_c = k * new_c + (1 - k) * c_prev
      new_h = k * new_h + (1 - k) * h_prev
  
      new_state = rnn_cell_impl.LSTMStateTuple(new_c, new_h)
  
      return new_h, new_state
function_tokens: def call ( self , inputs , state ) : ( c_prev , h_prev ) = state ( time , x ) = inputs in_mask_gates = [ x , h_prev ] if self . _use_peepholes : in_mask_gates . append ( c_prev ) with vs . variable_scope ( "mask_gates" ) : if self . _linear1 is None : self . _linear1 = _Linear ( in_mask_gates , 2 * self . _num_units , True ) mask_gates = math_ops . sigmoid ( self . _linear1 ( in_mask_gates ) ) [ input_gate , forget_gate ] = array_ops . split ( axis = 1 , num_or_size_splits = 2 , value = mask_gates ) with vs . variable_scope ( "new_input" ) : if self . _linear2 is None : self . _linear2 = _Linear ( [ x , h_prev ] , self . _num_units , True ) new_input = math_ops . tanh ( self . _linear2 ( [ x , h_prev ] ) ) new_c = ( c_prev * forget_gate + input_gate * new_input ) in_out_gate = [ x , h_prev ] if self . _use_peepholes : in_out_gate . append ( new_c ) with vs . variable_scope ( "output_gate" ) : if self . _linear3 is None : self . _linear3 = _Linear ( in_out_gate , self . _num_units , True ) output_gate = math_ops . sigmoid ( self . _linear3 ( in_out_gate ) ) new_h = math_ops . tanh ( new_c ) * output_gate period = vs . get_variable ( "period" , [ self . _num_units ] , initializer = _random_exp_initializer ( self . _period_init_min , self . _period_init_max ) ) phase = vs . get_variable ( "phase" , [ self . _num_units ] , initializer = init_ops . random_uniform_initializer ( 0. , period . initial_value ) ) ratio_on = vs . get_variable ( "ratio_on" , [ self . _num_units ] , initializer = init_ops . constant_initializer ( self . _ratio_on ) , trainable = self . _trainable_ratio_on ) cycle_ratio = self . _get_cycle_ratio ( time , phase , period ) k_up = 2 * cycle_ratio / ratio_on k_down = 2 - k_up k_closed = self . _leak * cycle_ratio k = array_ops . where ( cycle_ratio < ratio_on , k_down , k_closed ) k = array_ops . where ( cycle_ratio < 0.5 * ratio_on , k_up , k ) new_c = k * new_c + ( 1 - k ) * c_prev new_h = k * new_h + ( 1 - k ) * h_prev new_state = rnn_cell_impl . LSTMStateTuple ( new_c , new_h ) return new_h , new_state