class_docstr: File writer for TFRecord dataset.
  
  TFRecordWriter serializes tensors in tf.Example schema and write them
  into files in TFRecord format. The written file can be loaded with
  tf.data.TFRecordDataset.
class_docstr_tok: ["File","writer","for","TFRecord","dataset",".","TFRecordWriter","serializes","tensors","in","tf.Example","schema","and","write","them","into","files","in","TFRecord","format",".","The","written","file","can","be","loaded","with","tf.data.TFRecordDataset","."]
docstr: As tf.Example only supports tf.float32, tf.int64, and tf.string dtype.
  This function maps tensor dtype into the dtype supported by tf.Example.
docstr_tok: ["As","tf.Example","only","supports","tf.float32",",","tf.int64",",","and","tf.string","dtype",".","This","function","maps","tensor","dtype","into","the","dtype","supported","by","tf.Example","."]
code: def _map_tensor_dtype_to_example_dtype(self, dtype):
      """As tf.Example only supports tf.float32, tf.int64, and tf.string dtype.
      This function maps tensor dtype into the dtype supported by tf.Example.
      """
      if dtype in TFRecordWriter._INT64_LIST_DTYPE:
          return tf.int64
      elif dtype in TFRecordWriter._FLOAT_LIST_DTYPE:
          return tf.float32
      elif dtype in TFRecordWriter._BYTES_LIST_DTYPE:
          return tf.string
      else:
          raise TypeError(
              f"Dtype {dtype} is not supported in tf.Example."
          )
  
file_path: io/tests/test_atds_avro/utils/tf_record_writer.py
imports: import os
  from tests.test_atds_avro.utils.generator.tensor_generator import TensorGeneratorBase
  from tests.test_atds_avro.utils.generator.sparse_tensor_generator import SparseTensorGeneratorBase
  from tests.test_atds_avro.utils.generator.varlen_tensor_generator import VarLenTensorGeneratorBase
  import numpy
  import tensorflow
  from tests.test_atds_avro.utils.file_writer import FileWriter
label_desc: Use image node_id 6 for calling the TFRecordWriter obj's underlying member method code with example usage: obj._map_tensor_dtype_to_example_dtype(dtype) and returns: tf, tf, tf