class_docstr: An Arrow Dataset from record batches in memory, or a Pandas DataFrame.
docstr: Create an ArrowDataset directly from Arrow record batches.
  This constructor requires pyarrow to be installed.
  
  Args:
      record_batches: An Arrow record batch or sequence of record batches
      output_types: Tensor dtypes of the output tensors
      output_shapes: TensorShapes of the output tensors or None to
                      infer partial
      batch_size: Batch size of output tensors, setting a batch size here
                  will create batched tensors from Arrow memory and can be more
                  efficient than using tf.data.Dataset.batch().
                  NOTE: batch_size does not need to be set if batch_mode='auto'
      batch_mode: Mode of batching, supported strings:
                  "keep_remainder" (default, keeps partial batch data),
                  "drop_remainder" (discard partial batch data),
                  "auto" (size to number of records in Arrow record batch)
      columns: A list of column indices to be used in the Dataset
docstr_tok: ["Create","an","ArrowDataset","directly","from","Arrow","record","batches",".","This","constructor","requires","pyarrow","to","be","installed",".","Args",":","record_batches",":","An","Arrow","record","batch","or","sequence","of","record","batches","output_types",":","Tensor","dtypes","of","the","output","tensors","output_shapes",":","TensorShapes","of","the","output","tensors","or","None","to","infer","partial","batch_size",":","Batch","size","of","output","tensors",",","setting","a","batch","size","here","will","create","batched","tensors","from","Arrow","memory","and","can","be","more","efficient","than","using","tf.data.Dataset.batch","(",")",".","NOTE",":","batch_size","does","not","need","to","be","set","if","batch_mode='auto'","batch_mode",":","Mode","of","batching",",","supported","strings",":","``","keep_remainder","''","(","default",",","keeps","partial","batch","data",")",",","``","drop_remainder","''","(","discard","partial","batch","data",")",",","``","auto","''","(","size","to","number","of","records","in","Arrow","record","batch",")","columns",":","A","list","of","column","indices","to","be","used","in","the","Dataset"]
code: def from_record_batches(
      cls,
      record_batches,
      output_types,
      output_shapes=None,
      columns=None,
      batch_size=None,
      batch_mode="keep_remainder",
  ):
      """Create an ArrowDataset directly from Arrow record batches.
      This constructor requires pyarrow to be installed.
  
      Args:
          record_batches: An Arrow record batch or sequence of record batches
          output_types: Tensor dtypes of the output tensors
          output_shapes: TensorShapes of the output tensors or None to
                          infer partial
          batch_size: Batch size of output tensors, setting a batch size here
                      will create batched tensors from Arrow memory and can be more
                      efficient than using tf.data.Dataset.batch().
                      NOTE: batch_size does not need to be set if batch_mode='auto'
          batch_mode: Mode of batching, supported strings:
                      "keep_remainder" (default, keeps partial batch data),
                      "drop_remainder" (discard partial batch data),
                      "auto" (size to number of records in Arrow record batch)
          columns: A list of column indices to be used in the Dataset
      """
      import pyarrow as pa  # pylint: disable=import-outside-toplevel
  
      if isinstance(record_batches, pa.RecordBatch):
          record_batches = [record_batches]
      if columns is None:
          columns = tuple(range(record_batches[0].num_columns))
      assert record_batches
      if tf.executing_eagerly():
          sink = pa.BufferOutputStream()
          writer = pa.RecordBatchFileWriter(
              sink, record_batches[0].schema
          )
          for batch in record_batches:
              writer.write_batch(batch)
          writer.close()
          serialized_batches = None
          arrow_buffer = sink.getvalue()
      else:
          buf = io.BytesIO()
          writer = pa.RecordBatchFileWriter(
              buf, record_batches[0].schema
          )
          for batch in record_batches:
              writer.write_batch(batch)
          writer.close()
          serialized_batches = tf.convert_to_tensor(
              buf.getvalue(),
              dtype=dtypes.string,
              name="serialized_batches",
          )
          arrow_buffer = None
      return cls(
          serialized_batches,
          columns,
          output_types,
          output_shapes,
          batch_size=batch_size,
          batch_mode=batch_mode,
          arrow_buffer=arrow_buffer,
      )
  
imports: from functools import partial
  import io
  from itertools import chain
  import os
  import socket
  import threading
  import tempfile
  import tensorflow
  from tensorflow import dtypes
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.util import structure
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 2 for calling the ArrowDataset obj's underlying member method code with example usage: obj.from_record_batches(cls, record_batches, output_types, output_shapes, columns, batch_size, batch_mode) and returns: cls