code: def test_conv1d_record_states_first_part_mode(self):
      batch = 2
      d_model = 6
      length = 6
      filter_size = 3
  
      inputs = np.random.randint(1, 10, size=[batch, length])
      context = get_dummy_decoder_context(
          self.converter,
          batch=batch,
          d_model=d_model,
          initial_position=2,  # indices 0 and 1 correspond to partial sequences.
          inputs=inputs,
          mode="first_part",
      )
  
      x = np.zeros(shape=(batch, length, d_model))
      x_mtf = self.converter.convert_np_array_to_mtf_tensor(
          x, dtype=tf.float32, dim_names=["batch", "length", "d_model"]
      )
  
      conv_layer = transformer_layers.Conv1D()
      conv_layer.record_states_first_part_mode(
          context, x_mtf, filter_size
      )
      actual = self.converter.convert_mtf_tensor_to_np_array(
          context.new_states[0]
      )
      expected = np.zeros(shape=[batch, filter_size, d_model])
  
      self.assertAllClose(actual, expected)
  
imports: import collections
  import mesh_tensorflow
  from mesh_tensorflow import test_utils
  from mesh_tensorflow.transformer import transformer
  from mesh_tensorflow.transformer import transformer_layers
  import mock
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the TransformerLayersTest obj's underlying member method code with example usage: obj.test_conv1d_record_states_first_part_mode() without return types