code: def test_compute_output_shape_single_state(self):
      sequence = np.ones((3, 4, 5))
      layer = layers.RNN(OneStateRNNCell(8), return_sequences=False)
      output_shape = layer.compute_output_shape(sequence.shape)
      self.assertEqual(output_shape, (3, 8))
  
      layer = layers.RNN(OneStateRNNCell(8), return_sequences=True)
      output_shape = layer.compute_output_shape(sequence.shape)
      self.assertEqual(output_shape, (3, 4, 8))
  
      layer = layers.RNN(
          OneStateRNNCell(8), return_sequences=False, return_state=True
      )
      output_shape = layer.compute_output_shape(sequence.shape)
      self.assertEqual(output_shape[0], (3, 8))
      self.assertEqual(output_shape[1], (3, 8))
  
      layer = layers.RNN(
          OneStateRNNCell(8), return_sequences=True, return_state=True
      )
      output_shape = layer.compute_output_shape(sequence.shape)
      self.assertEqual(output_shape[0], (3, 4, 8))
      self.assertEqual(output_shape[1], (3, 8))
  
imports: import numpy
  import pytest
  from keras import layers
  from keras import ops
  from keras import testing
label_desc: Use image node_id 2 for calling the RNNTest obj's underlying member method code with example usage: obj.test_compute_output_shape_single_state() without return types