code: def testRecordToExample(self):
      encoder = dna_encoder.DNAEncoder(chunk_size=2)
      raw_inputs = ["A", "C", "G", "N", "C", "T"]
  
      # Put in numpy arrays in the same format as in the h5 file
      inputs = self._one_hot_bases(raw_inputs)
      mask = np.array([True, False, True])
      outputs = np.array(
          [[1.0, 2.0, 3.0], [5.0, 1.0, 0.2], [5.1, 2.3, 2.3]]
      )
      # Convert to example dict
      ex_dict = gene_expression.to_example_dict(
          encoder, inputs, mask, outputs
      )
  
      self.assertEqual(len(raw_inputs) // 2 + 1, len(ex_dict["inputs"]))
      self.assertAllEqual(
          encoder.encode(raw_inputs) + [1], ex_dict["inputs"]
      )
      self.assertAllEqual([1.0, 0.0, 1.0], ex_dict["targets_mask"])
      self.assertAllEqual(
          [1.0, 2.0, 3.0, 5.0, 1.0, 0.2, 5.1, 2.3, 2.3],
          ex_dict["targets"],
      )
      self.assertAllEqual([3, 3], ex_dict["targets_shape"])
  
file_path: tensor2tensor/tensor2tensor/data_generators/gene_expression_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.data_generators import dna_encoder
  from tensor2tensor.data_generators import gene_expression
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the GeneticsTest obj's underlying member method code with example usage: obj.testRecordToExample() without return types