code: def testValues(self):
      batch_size = 4
      num_writes = 2
      memory_size = 5
      word_size = 3
  
      # Random memory, weights and values (batch_size=1)
      mem = tf.random.uniform((batch_size, memory_size, word_size))
      # Non-repeated indices in [0, memory_size)
      indices = np.random.permutation(memory_size)[:num_writes]
      # One-hot representation
      write_address = tf.constant(
          np.tile(np.eye(memory_size)[indices], [batch_size, 1, 1]),
          dtype=tf.float32,
      )
  
      reset_weights = tf.ones((batch_size, num_writes, word_size), 1)
      write_values = tf.random.uniform(
          [batch_size, num_writes, word_size]
      )
  
      written_mem = write.erase_and_write(
          mem, write_address, reset_weights, write_values
      )
  
      self.assertAllClose(
          written_mem.numpy()[0, indices, :],
          write_values.numpy()[0],
          atol=2e-3,
      )
  
file_path: sonnet/sonnet/src/nets/dnc/write_test.py
imports: import numpy
  from sonnet.src import test_utils
  from sonnet.src.nets.dnc import write
  import tensorflow
label_desc: Use image node_id 2 for calling the EraseAndWriteTest obj's underlying member method code with example usage: obj.testValues() without return types