class_docstr: Neighbor Ops Test. Test get neighbors ops for nodes
class_docstr_tok: ["Neighbor","Ops","Test",".","Test","get","neighbors","ops","for","nodes"]
docstr: Test sample neighbor layerwise
docstr_tok: ["Test","sample","neighbor","layerwise"]
code: def testSampleNeighborLayerwiseWithAdj(self):
      """Test sample neighbor layerwise"""
  
      ans_adj = set(
          [(1, 2), (1, 3), (1, 4), (2, 3), (2, 5), (3, 4), (4, 5)]
      )
      src_nodes = [[1, 2, 3], [1, 2, 3], [2, 3, 4], [2, 2, 4]]
      op = ops.sample_neighbor_layerwise(
          src_nodes, ["0", "1"], 10, -1, "sqrt"
      )
      with tf.Session() as sess:
          for i in range(0, 1):
              ids, adj = sess.run(op)
              adj = sess.run(tf.sparse_tensor_to_dense(adj))
              [self.assertTrue(n1 in [2, 3, 4, 5]) for n1 in ids[0]]
              [self.assertTrue(n2 in [3, 4, 5]) for n2 in ids[2]]
              [self.assertTrue(n3 in [3, 5]) for n3 in ids[3]]
              for bs in range(0, 4):
                  for src_idx in range(0, 3):
                      for dst_idx in range(0, 10):
                          pair = (
                              src_nodes[bs][src_idx],
                              ids[bs][dst_idx],
                          )
                          self.assertTrue(
                              (pair in ans_adj)
                              == adj[bs][src_idx][dst_idx],
                              "{},{},{},pair:{}".format(
                                  bs, src_idx, dst_idx, pair
                              ),
                          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import subprocess
  from tensorflow.python.platform import test
  import tensorflow
  from tf_euler.python.euler_ops import base
  from tf_euler.python.euler_ops import neighbor_ops
label_desc: Use image node_id 10 for calling the NeighborOpsTest obj's underlying member method code with example usage: obj.testSampleNeighborLayerwiseWithAdj() without return types