Class BatchingOptions.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BatchingOptions.Builder>
com.google.protobuf.GeneratedMessage.Builder<BatchingOptions.Builder>
org.tensorflow.proto.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 Summary
Modifier and TypeMethodDescriptionaddAllAllowedBatchSizes(Iterable<? extends Integer> values) Optional list of allowed batch sizes.addAllowedBatchSizes(int value) Optional list of allowed batch sizes.build()clear()Optional list of allowed batch sizes.Maximum number of microseconds to wait before outputting an incomplete batch.The maximum allowed batch size.Maximum number of batches enqueued for processing before requests are failed fast.Number of scheduling threads for processing batches of work.intgetAllowedBatchSizes(int index) Optional list of allowed batch sizes.intOptional list of allowed batch sizes.Optional list of allowed batch sizes.intMaximum number of microseconds to wait before outputting an incomplete batch.static final Descriptors.DescriptorintThe maximum allowed batch size.intMaximum number of batches enqueued for processing before requests are failed fast.intNumber of scheduling threads for processing batches of work.protected GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) mergeFrom(BatchingOptions other) setAllowedBatchSizes(int index, int value) Optional list of allowed batch sizes.setBatchTimeoutMicros(int value) Maximum number of microseconds to wait before outputting an incomplete batch.setMaxBatchSize(int value) The maximum allowed batch size.setMaxEnqueuedBatches(int value) Maximum number of batches enqueued for processing before requests are failed fast.setNumBatchThreads(int value) Number of scheduling threads for processing batches of work.Methods inherited from class GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
-
Method Details
-
getDescriptor
-
internalGetFieldAccessorTable
- Specified by:
internalGetFieldAccessorTablein classGeneratedMessage.Builder<BatchingOptions.Builder>
-
clear
- Specified by:
clearin interfaceMessage.Builder- Specified by:
clearin interfaceMessageLite.Builder- Overrides:
clearin classGeneratedMessage.Builder<BatchingOptions.Builder>
-
getDescriptorForType
- Specified by:
getDescriptorForTypein interfaceMessage.Builder- Specified by:
getDescriptorForTypein interfaceMessageOrBuilder- Overrides:
getDescriptorForTypein classGeneratedMessage.Builder<BatchingOptions.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfaceMessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceMessageOrBuilder
-
build
- Specified by:
buildin interfaceMessage.Builder- Specified by:
buildin interfaceMessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfaceMessage.Builder- Specified by:
buildPartialin interfaceMessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfaceMessage.Builder- Overrides:
mergeFromin classAbstractMessage.Builder<BatchingOptions.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfaceMessageLiteOrBuilder- Overrides:
isInitializedin classGeneratedMessage.Builder<BatchingOptions.Builder>
-
mergeFrom
public BatchingOptions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfaceMessage.Builder- Specified by:
mergeFromin interfaceMessageLite.Builder- Overrides:
mergeFromin classAbstractMessage.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:
getNumBatchThreadsin interfaceBatchingOptionsOrBuilder- Returns:
- The numBatchThreads.
-
setNumBatchThreads
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
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:
getMaxBatchSizein interfaceBatchingOptionsOrBuilder- Returns:
- The maxBatchSize.
-
setMaxBatchSize
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
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:
getBatchTimeoutMicrosin interfaceBatchingOptionsOrBuilder- Returns:
- The batchTimeoutMicros.
-
setBatchTimeoutMicros
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
Maximum number of microseconds to wait before outputting an incomplete batch.
int32 batch_timeout_micros = 3;- Returns:
- This builder for chaining.
-
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:
getAllowedBatchSizesListin interfaceBatchingOptionsOrBuilder- 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:
getAllowedBatchSizesCountin interfaceBatchingOptionsOrBuilder- 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:
getAllowedBatchSizesin interfaceBatchingOptionsOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The allowedBatchSizes at the given index.
-
setAllowedBatchSizes
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
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
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
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:
getMaxEnqueuedBatchesin interfaceBatchingOptionsOrBuilder- Returns:
- The maxEnqueuedBatches.
-
setMaxEnqueuedBatches
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
Maximum number of batches enqueued for processing before requests are failed fast.
int32 max_enqueued_batches = 5;- Returns:
- This builder for chaining.
-