class_docstr: An Arrow Dataset from record batches in memory, or a Pandas DataFrame.
docstr: Create an ArrowDataset from a Tensor of serialized batches.
  This constructor requires pyarrow to be installed.
  
  Args:
      serialized_batches: A string Tensor as a serialized buffer containing
                          Arrow record batches in Arrow File format
      columns: A list of column indices to be used in the Dataset
      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)
      arrow_buffer: Optional Arrow Buffer containing Arrow record batches in
                  Arrow File format. This will share the Arrow buffer with
                  the C++ kernel by address for zero-copy. Only supported if
                  the kernel process is local, with TensorFlow in eager mode.
                  If this is used, set `serialized_batches` to `None`.
docstr_tok: ["Create","an","ArrowDataset","from","a","Tensor","of","serialized","batches",".","This","constructor","requires","pyarrow","to","be","installed",".","Args",":","serialized_batches",":","A","string","Tensor","as","a","serialized","buffer","containing","Arrow","record","batches","in","Arrow","File","format","columns",":","A","list","of","column","indices","to","be","used","in","the","Dataset","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",")","arrow_buffer",":","Optional","Arrow","Buffer","containing","Arrow","record","batches","in","Arrow","File","format",".","This","will","share","the","Arrow","buffer","with","the","C++","kernel","by","address","for","zero-copy",".","Only","supported","if","the","kernel","process","is","local",",","with","TensorFlow","in","eager","mode",".","If","this","is","used",",","set","`","serialized_batches","`","to","`","None","`","."]
code: def __init__(
      self,
      serialized_batches,
      columns,
      output_types,
      output_shapes=None,
      batch_size=None,
      batch_mode="keep_remainder",
      arrow_buffer=None,
  ):
      """Create an ArrowDataset from a Tensor of serialized batches.
      This constructor requires pyarrow to be installed.
  
      Args:
          serialized_batches: A string Tensor as a serialized buffer containing
                              Arrow record batches in Arrow File format
          columns: A list of column indices to be used in the Dataset
          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)
          arrow_buffer: Optional Arrow Buffer containing Arrow record batches in
                      Arrow File format. This will share the Arrow buffer with
                      the C++ kernel by address for zero-copy. Only supported if
                      the kernel process is local, with TensorFlow in eager mode.
                      If this is used, set `serialized_batches` to `None`.
      """
      if serialized_batches is not None:
          make_variant_fn = partial(
              core_ops.io_arrow_serialized_dataset, serialized_batches
          )
      elif arrow_buffer is None:
          raise ValueError(
              "Must set either serialzied_batches or arrow_buffer"
          )
      elif not tf.executing_eagerly():
          raise ValueError(
              "Using arrow_buffer for zero-copy only supported in "
              "TensorFlow Eager mode."
          )
      else:
          address_int = arrow_buffer.address
          buffer_address = tf.convert_to_tensor(
              address_int, dtype=dtypes.uint64, name="buffer_address"
          )
          buffer_size = tf.convert_to_tensor(
              arrow_buffer.size, dtype=dtypes.int64, name="buffer_size"
          )
          make_variant_fn = partial(
              core_ops.io_arrow_zero_copy_dataset,
              buffer_address,
              buffer_size,
          )
          # Keep a reference to the arrow buffers used
          self._arrow_buffer_refs = [arrow_buffer]
      super().__init__(
          make_variant_fn,
          columns,
          output_types,
          output_shapes,
          batch_size,
          batch_mode,
      )
  
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 1 to create a new ArrowDataset object from inherited base classes: ArrowBaseDataset with example: obj = ArrowDataset(serialized_batches, columns, output_types, output_shapes, batch_size, batch_mode, arrow_buffer)