class_docstr: IODataset
docstr: Write dataset to a file.
  
  Args:
    dataset: A dataset whose content will be written to.
    filename: A string, the filename of the file to write to.
    name: A name prefix for the IODataset (optional).
  
  Returns:
    The number of records written.
docstr_tok: ["Write","dataset","to","a","file",".","Args",":","dataset",":","A","dataset","whose","content","will","be","written","to",".","filename",":","A","string",",","the","filename","of","the","file","to","write","to",".","name",":","A","name","prefix","for","the","IODataset","(","optional",")",".","Returns",":","The","number","of","records","written","."]
code: def to_file(cls, dataset, filename, **kwargs):
      """Write dataset to a file.
  
      Args:
        dataset: A dataset whose content will be written to.
        filename: A string, the filename of the file to write to.
        name: A name prefix for the IODataset (optional).
  
      Returns:
        The number of records written.
      """
      with tf.name_scope(kwargs.get("name", "IOToText")):
          return file_dataset_ops.to_file(dataset, filename)
  
imports: import tensorflow
  from tensorflow_io.python.ops import io_dataset
  from tensorflow_io.python.experimental import libsvm_dataset_ops
  from tensorflow_io.python.experimental import image_dataset_ops
  from tensorflow_io.python.experimental import kinesis_dataset_ops
  from tensorflow_io.python.experimental import pubsub_dataset_ops
  from tensorflow_io.python.experimental import grpc_dataset_ops
  from tensorflow_io.python.experimental import file_dataset_ops
  from tensorflow_io.python.experimental import numpy_dataset_ops
  from tensorflow_io.python.experimental import sql_dataset_ops
  from tensorflow_io.python.experimental import video_dataset_ops
label_desc: Use image node_id 10 for calling the IODataset obj's underlying member method code with example usage: obj.to_file(cls, dataset, filename) and returns: file_dataset_ops