code: def test_brute_force_topk(self):
      cs_config = cs_config_builder.build_candidate_sampler_config(
          cs_config_builder.brute_force_topk_sampler("DOT_PRODUCT")
      )
      de_config = test_util.default_de_config(2, cs_config=cs_config)
      # Add a few embeddings into knowledge bank.
      de_ops.dynamic_embedding_update(
          ["key1", "key2", "key3"],
          tf.constant([[2.0, 4.0], [4.0, 8.0], [8.0, 16.0]]),
          de_config,
          "emb",
          service_address=self._kbs_address,
      )
  
      keys, logits = cs_ops.top_k(
          [[1.0, 2.0], [-1.0, -2.0]],
          3,
          de_config,
          "emb",
          service_address=self._kbs_address,
      )
      self.assertAllEqual(
          keys.numpy(),
          [[b"key3", b"key2", b"key1"], [b"key1", b"key2", b"key3"]],
      )
      self.assertAllClose(
          logits.numpy(), [[40, 20, 10], [-10, -20, -40]]
      )
  
file_path: neural-structured-learning/research/carls/candidate_sampling_ops_test.py
imports: from research.carls import candidate_sampling_ops
  from research.carls import context
  from research.carls import dynamic_embedding_ops
  from research.carls.candidate_sampling import candidate_sampler_config_builder
  from research.carls.testing import test_util
  import tensorflow
label_desc: Use image node_id 3 for calling the CandidateSamplingOpsTest obj's underlying member method code with example usage: obj.test_brute_force_topk() without return types