code: def testGaussianMemoryLookupWithMultiCluster_3DInput(self):
      dm_config = test_util.default_dm_config(
          per_cluster_buffer_size=4,
          distance_to_cluster_threshold=0.5,
          bootstrap_steps=0,
          min_variance=1,
          max_num_clusters=4,
      )
      inputs = [[[0, 0], [1, 0]], [[101, 0], [0, 101]]]
      mode = dm_ops.LOOKUP_WITH_UPDATE
      (
          mean,
          variance,
          distance,
          cid,
      ) = dm_ops.dynamic_gaussian_memory_lookup(
          inputs,
          mode,
          dm_config,
          "dm_layer",
          service_address=self._kbs_address,
      )
  
      # Mean: [(1 + 101) / 4, 101 / 4]
      self.assertAllClose(
          mean.numpy(),
          [
              [[25.5, 25.25], [25.5, 25.25]],
              [[25.5, 25.25], [25.5, 25.25]],
          ],
      )
      self.assertAllClose(
          variance.numpy(),
          [
              [[1900.25, 1912.6875], [1900.25, 1912.6875]],
              [[1900.25, 1912.6875], [1900.25, 1912.6875]],
          ],
      )
      self.assertAllClose(
          distance.numpy(),
          [[0.84460914, 0.85018337], [0.43462682, 0.4336368]],
      )
      self.assertAllClose(cid.numpy(), [[0, 0], [0, 0]])
  
      # Lookup with grow, new clusters are formed for [101, 0] and [0, 101].
      mode = dm_ops.LOOKUP_WITH_GROW
      (
          mean,
          variance,
          distance,
          cid,
      ) = dm_ops.dynamic_gaussian_memory_lookup(
          inputs,
          mode,
          dm_config,
          "dm_layer",
          service_address=self._kbs_address,
      )
      self.assertAllClose(
          mean.numpy(),
          [[[25.5, 25.25], [25.5, 25.25]], [[101, 0], [0, 101]]],
      )
      self.assertAllClose(
          variance.numpy(),
          [
              [[1900.25, 1912.6875], [1900.25, 1912.6875]],
              [[1, 1], [1, 1]],
          ],
      )
      self.assertAllClose(
          distance.numpy(), [[0.84460914, 0.85018337], [1, 1]]
      )
      self.assertAllClose(cid.numpy(), [[0, 0], [1, 2]])
  
file_path: neural-structured-learning/research/carls/dynamic_memory_ops_test.py
imports: from research.carls import context
  from research.carls import dynamic_memory_ops
  from research.carls.testing import test_util
  import tensorflow
label_desc: Use image node_id 6 for calling the DynamicMemoryOpsTest obj's underlying member method code with example usage: obj.testGaussianMemoryLookupWithMultiCluster_3DInput() without return types