Class BatchingOptions.Builder

All Implemented Interfaces:
Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, Cloneable, BatchingOptionsOrBuilder
Enclosing class:
BatchingOptions

public static final class BatchingOptions.Builder extends GeneratedMessage.Builder<BatchingOptions.Builder> implements BatchingOptionsOrBuilder
Protobuf type tensorflow.BatchingOptions
  • Method Details

    • getDescriptor

      public static final Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class GeneratedMessage.Builder<BatchingOptions.Builder>
    • clear

      public BatchingOptions.Builder clear()
      Specified by:
      clear in interface Message.Builder
      Specified by:
      clear in interface MessageLite.Builder
      Overrides:
      clear in class GeneratedMessage.Builder<BatchingOptions.Builder>
    • getDescriptorForType

      public Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface Message.Builder
      Specified by:
      getDescriptorForType in interface MessageOrBuilder
      Overrides:
      getDescriptorForType in class GeneratedMessage.Builder<BatchingOptions.Builder>
    • getDefaultInstanceForType

      public BatchingOptions getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface MessageOrBuilder
    • build

      public BatchingOptions build()
      Specified by:
      build in interface Message.Builder
      Specified by:
      build in interface MessageLite.Builder
    • buildPartial

      public BatchingOptions buildPartial()
      Specified by:
      buildPartial in interface Message.Builder
      Specified by:
      buildPartial in interface MessageLite.Builder
    • mergeFrom

      public BatchingOptions.Builder mergeFrom(Message other)
      Specified by:
      mergeFrom in interface Message.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<BatchingOptions.Builder>
    • mergeFrom

      public BatchingOptions.Builder mergeFrom(BatchingOptions other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface MessageLiteOrBuilder
      Overrides:
      isInitialized in class GeneratedMessage.Builder<BatchingOptions.Builder>
    • mergeFrom

      public BatchingOptions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface Message.Builder
      Specified by:
      mergeFrom in interface MessageLite.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<BatchingOptions.Builder>
      Throws:
      IOException
    • getNumBatchThreads

      public int getNumBatchThreads()
      Number of scheduling threads for processing batches of work. Determines
      the number of batches processed in parallel. This should be roughly in line
      with the number of TPU cores available.
      
      int32 num_batch_threads = 1;
      Specified by:
      getNumBatchThreads in interface BatchingOptionsOrBuilder
      Returns:
      The numBatchThreads.
    • setNumBatchThreads

      public BatchingOptions.Builder setNumBatchThreads(int value)
      Number of scheduling threads for processing batches of work. Determines
      the number of batches processed in parallel. This should be roughly in line
      with the number of TPU cores available.
      
      int32 num_batch_threads = 1;
      Parameters:
      value - The numBatchThreads to set.
      Returns:
      This builder for chaining.
    • clearNumBatchThreads

      public BatchingOptions.Builder clearNumBatchThreads()
      Number of scheduling threads for processing batches of work. Determines
      the number of batches processed in parallel. This should be roughly in line
      with the number of TPU cores available.
      
      int32 num_batch_threads = 1;
      Returns:
      This builder for chaining.
    • getMaxBatchSize

      public int getMaxBatchSize()
      The maximum allowed batch size. Can be larger than allowed_batch_sizes to
      utilize large batch splitting.
      
      int32 max_batch_size = 2;
      Specified by:
      getMaxBatchSize in interface BatchingOptionsOrBuilder
      Returns:
      The maxBatchSize.
    • setMaxBatchSize

      public BatchingOptions.Builder setMaxBatchSize(int value)
      The maximum allowed batch size. Can be larger than allowed_batch_sizes to
      utilize large batch splitting.
      
      int32 max_batch_size = 2;
      Parameters:
      value - The maxBatchSize to set.
      Returns:
      This builder for chaining.
    • clearMaxBatchSize

      public BatchingOptions.Builder clearMaxBatchSize()
      The maximum allowed batch size. Can be larger than allowed_batch_sizes to
      utilize large batch splitting.
      
      int32 max_batch_size = 2;
      Returns:
      This builder for chaining.
    • getBatchTimeoutMicros

      public int getBatchTimeoutMicros()
      Maximum number of microseconds to wait before outputting an incomplete
      batch.
      
      int32 batch_timeout_micros = 3;
      Specified by:
      getBatchTimeoutMicros in interface BatchingOptionsOrBuilder
      Returns:
      The batchTimeoutMicros.
    • setBatchTimeoutMicros

      public BatchingOptions.Builder setBatchTimeoutMicros(int value)
      Maximum number of microseconds to wait before outputting an incomplete
      batch.
      
      int32 batch_timeout_micros = 3;
      Parameters:
      value - The batchTimeoutMicros to set.
      Returns:
      This builder for chaining.
    • clearBatchTimeoutMicros

      public BatchingOptions.Builder clearBatchTimeoutMicros()
      Maximum number of microseconds to wait before outputting an incomplete
      batch.
      
      int32 batch_timeout_micros = 3;
      Returns:
      This builder for chaining.
    • getAllowedBatchSizesList

      public List<Integer> getAllowedBatchSizesList()
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Specified by:
      getAllowedBatchSizesList in interface BatchingOptionsOrBuilder
      Returns:
      A list containing the allowedBatchSizes.
    • getAllowedBatchSizesCount

      public int getAllowedBatchSizesCount()
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Specified by:
      getAllowedBatchSizesCount in interface BatchingOptionsOrBuilder
      Returns:
      The count of allowedBatchSizes.
    • getAllowedBatchSizes

      public int getAllowedBatchSizes(int index)
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Specified by:
      getAllowedBatchSizes in interface BatchingOptionsOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The allowedBatchSizes at the given index.
    • setAllowedBatchSizes

      public BatchingOptions.Builder setAllowedBatchSizes(int index, int value)
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Parameters:
      index - The index to set the value at.
      value - The allowedBatchSizes to set.
      Returns:
      This builder for chaining.
    • addAllowedBatchSizes

      public BatchingOptions.Builder addAllowedBatchSizes(int value)
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Parameters:
      value - The allowedBatchSizes to add.
      Returns:
      This builder for chaining.
    • addAllAllowedBatchSizes

      public BatchingOptions.Builder addAllAllowedBatchSizes(Iterable<? extends Integer> values)
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Parameters:
      values - The allowedBatchSizes to add.
      Returns:
      This builder for chaining.
    • clearAllowedBatchSizes

      public BatchingOptions.Builder clearAllowedBatchSizes()
      Optional list of allowed batch sizes. If left empty, does nothing.
      Otherwise, supplies a list of batch sizes, causing the op to pad batches up
      to one of those sizes. The entries must increase monotonically, and the
      final entry must be equal or less than the max_batch_size.
      
      repeated int32 allowed_batch_sizes = 4;
      Returns:
      This builder for chaining.
    • getMaxEnqueuedBatches

      public int getMaxEnqueuedBatches()
      Maximum number of batches enqueued for processing before requests are
      failed fast.
      
      int32 max_enqueued_batches = 5;
      Specified by:
      getMaxEnqueuedBatches in interface BatchingOptionsOrBuilder
      Returns:
      The maxEnqueuedBatches.
    • setMaxEnqueuedBatches

      public BatchingOptions.Builder setMaxEnqueuedBatches(int value)
      Maximum number of batches enqueued for processing before requests are
      failed fast.
      
      int32 max_enqueued_batches = 5;
      Parameters:
      value - The maxEnqueuedBatches to set.
      Returns:
      This builder for chaining.
    • clearMaxEnqueuedBatches

      public BatchingOptions.Builder clearMaxEnqueuedBatches()
      Maximum number of batches enqueued for processing before requests are
      failed fast.
      
      int32 max_enqueued_batches = 5;
      Returns:
      This builder for chaining.