code: def test_dense_vector_to_id_list_ref(self):
      # Verify that the reference implementation is correct!
      dense_input = np.array(
          [
              [1, 0, 0, 1, 0, 0, 0, 1],
              [1, 0, 1, 0, 0, 0, 0, 1],
              [0, 1, 0, 0, 0, 1, 0, 1],
          ],
          dtype=np.float32,
      )
      sparse_lengths, sparse_values = dense_vector_to_id_list_ref(
          dense_input
      )
      expected_lengths = np.array([3, 3, 3], dtype=np.int32)
      expected_values = np.array(
          [0, 3, 7, 0, 2, 7, 1, 5, 7], dtype=np.int64
      )
  
      np.testing.assert_array_equal(sparse_lengths, expected_lengths)
      np.testing.assert_array_equal(sparse_values, expected_values)
  
file_path: pytorch/caffe2/python/operator_test/dense_vector_to_id_list_op_test.py
imports: from caffe2.python import core
  from hypothesis import given
  import caffe2.python.hypothesis_test_util
  import hypothesis.extra.numpy
  import hypothesis.strategies
  import numpy
label_desc: Use image node_id 1 for calling the TestDenseVectorToIdList obj's underlying member method code with example usage: obj.test_dense_vector_to_id_list_ref() without return types