code: def testValues(self):
      num_writes = 2
      memory_size = 5
      word_size = 3
  
      # Random memory, weights and values (batch_size=1)
      mem = tf.random.uniform((1, memory_size, word_size))
      mem_np = mem.numpy()
      # Non-repeated indices in [0, memory_size)
      perm = np.random.permutation(memory_size)
      indices_np = perm[:num_writes]
      excluded_indices_np = perm[num_writes:]
  
      # One-hot representation
      write_address = tf.constant(
          np.expand_dims(np.eye(memory_size)[indices_np], axis=0),
          dtype=tf.float32,
      )
      reset_row_weights = tf.ones((1, num_writes))
  
      erased_mem = write.erase_rows(
          mem, write_address, reset_row_weights
      )
  
      not_erased_mem = write.erase_rows(
          mem, write_address, reset_row_weights * 0
      )
  
      erased_mem_np = erased_mem.numpy()
  
      # Rows specified in indices should have been erased.
      self.assertAllClose(
          erased_mem_np[0, indices_np, :],
          np.zeros((num_writes, word_size)),
          atol=2e-3,
      )
  
      # Other rows should not have been erased.
      self.assertAllClose(
          erased_mem_np[0, excluded_indices_np, :],
          mem_np[0, excluded_indices_np, :],
          atol=2e-3,
      )
  
      # Write with reset weights zero'd out and nothing should change.
      self.assertAllEqual(not_erased_mem.numpy(), mem_np)
  
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 EraseRowsTest obj's underlying member method code with example usage: obj.testValues() without return types