Package org.tensorflow.framework
Class OptimizerOptions.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<OptimizerOptions.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
org.tensorflow.framework.OptimizerOptions.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable,OptimizerOptionsOrBuilder
- Enclosing class:
OptimizerOptions
public static final class OptimizerOptions.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
implements OptimizerOptionsOrBuilder
Options passed to the graph optimizerProtobuf type
tensorflow.OptimizerOptions-
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()CPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.If true, optimize the graph using common subexpression elimination.If true, perform constant folding optimization on the graph.If true, perform function inlining on the graph.clearField(com.google.protobuf.Descriptors.FieldDescriptor field) .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;Constant folding optimization replaces tensors whose values can be predetermined, with constant nodes.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) Overall optimization level.clone()booleanCPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanIf true, optimize the graph using common subexpression elimination.booleanIf true, perform constant folding optimization on the graph.booleanIf true, perform function inlining on the graph..tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;int.tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;longConstant folding optimization replaces tensors whose values can be predetermined, with constant nodes.Overall optimization level.intOverall optimization level.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeFrom(OptimizerOptions other) final OptimizerOptions.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setCpuGlobalJit(boolean value) CPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.setDoCommonSubexpressionElimination(boolean value) If true, optimize the graph using common subexpression elimination.setDoConstantFolding(boolean value) If true, perform constant folding optimization on the graph.setDoFunctionInlining(boolean value) If true, perform function inlining on the graph..tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;setGlobalJitLevelValue(int value) .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;setMaxFoldedConstantInBytes(long value) Constant folding optimization replaces tensors whose values can be predetermined, with constant nodes.Overall optimization level.setOptLevelValue(int value) Overall optimization level.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) final OptimizerOptions.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
setField
public OptimizerOptions.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
setRepeatedField
public OptimizerOptions.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
addRepeatedField
public OptimizerOptions.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<OptimizerOptions.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
mergeFrom
public OptimizerOptions.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<OptimizerOptions.Builder>- Throws:
IOException
-
getDoCommonSubexpressionElimination
public boolean getDoCommonSubexpressionElimination()If true, optimize the graph using common subexpression elimination. Note: the optimization Level L1 will override this setting to true. So in order to disable common subexpression elimination the opt_level has to be set to L0.
bool do_common_subexpression_elimination = 1;- Specified by:
getDoCommonSubexpressionEliminationin interfaceOptimizerOptionsOrBuilder- Returns:
- The doCommonSubexpressionElimination.
-
setDoCommonSubexpressionElimination
If true, optimize the graph using common subexpression elimination. Note: the optimization Level L1 will override this setting to true. So in order to disable common subexpression elimination the opt_level has to be set to L0.
bool do_common_subexpression_elimination = 1;- Parameters:
value- The doCommonSubexpressionElimination to set.- Returns:
- This builder for chaining.
-
clearDoCommonSubexpressionElimination
If true, optimize the graph using common subexpression elimination. Note: the optimization Level L1 will override this setting to true. So in order to disable common subexpression elimination the opt_level has to be set to L0.
bool do_common_subexpression_elimination = 1;- Returns:
- This builder for chaining.
-
getDoConstantFolding
public boolean getDoConstantFolding()If true, perform constant folding optimization on the graph. Note: the optimization Level L1 will override this setting to true. So in order to disable constant folding the opt_level has to be set to L0.
bool do_constant_folding = 2;- Specified by:
getDoConstantFoldingin interfaceOptimizerOptionsOrBuilder- Returns:
- The doConstantFolding.
-
setDoConstantFolding
If true, perform constant folding optimization on the graph. Note: the optimization Level L1 will override this setting to true. So in order to disable constant folding the opt_level has to be set to L0.
bool do_constant_folding = 2;- Parameters:
value- The doConstantFolding to set.- Returns:
- This builder for chaining.
-
clearDoConstantFolding
If true, perform constant folding optimization on the graph. Note: the optimization Level L1 will override this setting to true. So in order to disable constant folding the opt_level has to be set to L0.
bool do_constant_folding = 2;- Returns:
- This builder for chaining.
-
getMaxFoldedConstantInBytes
public long getMaxFoldedConstantInBytes()Constant folding optimization replaces tensors whose values can be predetermined, with constant nodes. To avoid inserting too large constants, the size of each constant created can be limited. If this value is zero, a default limit of 10 MiB will be applied. If constant folding optimization is disabled, this value is ignored.
int64 max_folded_constant_in_bytes = 6;- Specified by:
getMaxFoldedConstantInBytesin interfaceOptimizerOptionsOrBuilder- Returns:
- The maxFoldedConstantInBytes.
-
setMaxFoldedConstantInBytes
Constant folding optimization replaces tensors whose values can be predetermined, with constant nodes. To avoid inserting too large constants, the size of each constant created can be limited. If this value is zero, a default limit of 10 MiB will be applied. If constant folding optimization is disabled, this value is ignored.
int64 max_folded_constant_in_bytes = 6;- Parameters:
value- The maxFoldedConstantInBytes to set.- Returns:
- This builder for chaining.
-
clearMaxFoldedConstantInBytes
Constant folding optimization replaces tensors whose values can be predetermined, with constant nodes. To avoid inserting too large constants, the size of each constant created can be limited. If this value is zero, a default limit of 10 MiB will be applied. If constant folding optimization is disabled, this value is ignored.
int64 max_folded_constant_in_bytes = 6;- Returns:
- This builder for chaining.
-
getDoFunctionInlining
public boolean getDoFunctionInlining()If true, perform function inlining on the graph.
bool do_function_inlining = 4;- Specified by:
getDoFunctionInliningin interfaceOptimizerOptionsOrBuilder- Returns:
- The doFunctionInlining.
-
setDoFunctionInlining
If true, perform function inlining on the graph.
bool do_function_inlining = 4;- Parameters:
value- The doFunctionInlining to set.- Returns:
- This builder for chaining.
-
clearDoFunctionInlining
If true, perform function inlining on the graph.
bool do_function_inlining = 4;- Returns:
- This builder for chaining.
-
getOptLevelValue
public int getOptLevelValue()Overall optimization level. The actual optimizations applied will be the logical OR of the flags that this level implies and any flags already set.
.tensorflow.OptimizerOptions.Level opt_level = 3;- Specified by:
getOptLevelValuein interfaceOptimizerOptionsOrBuilder- Returns:
- The enum numeric value on the wire for optLevel.
-
setOptLevelValue
Overall optimization level. The actual optimizations applied will be the logical OR of the flags that this level implies and any flags already set.
.tensorflow.OptimizerOptions.Level opt_level = 3;- Parameters:
value- The enum numeric value on the wire for optLevel to set.- Returns:
- This builder for chaining.
-
getOptLevel
Overall optimization level. The actual optimizations applied will be the logical OR of the flags that this level implies and any flags already set.
.tensorflow.OptimizerOptions.Level opt_level = 3;- Specified by:
getOptLevelin interfaceOptimizerOptionsOrBuilder- Returns:
- The optLevel.
-
setOptLevel
Overall optimization level. The actual optimizations applied will be the logical OR of the flags that this level implies and any flags already set.
.tensorflow.OptimizerOptions.Level opt_level = 3;- Parameters:
value- The optLevel to set.- Returns:
- This builder for chaining.
-
clearOptLevel
Overall optimization level. The actual optimizations applied will be the logical OR of the flags that this level implies and any flags already set.
.tensorflow.OptimizerOptions.Level opt_level = 3;- Returns:
- This builder for chaining.
-
getGlobalJitLevelValue
public int getGlobalJitLevelValue().tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;- Specified by:
getGlobalJitLevelValuein interfaceOptimizerOptionsOrBuilder- Returns:
- The enum numeric value on the wire for globalJitLevel.
-
setGlobalJitLevelValue
.tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;- Parameters:
value- The enum numeric value on the wire for globalJitLevel to set.- Returns:
- This builder for chaining.
-
getGlobalJitLevel
.tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;- Specified by:
getGlobalJitLevelin interfaceOptimizerOptionsOrBuilder- Returns:
- The globalJitLevel.
-
setGlobalJitLevel
.tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;- Parameters:
value- The globalJitLevel to set.- Returns:
- This builder for chaining.
-
clearGlobalJitLevel
.tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;- Returns:
- This builder for chaining.
-
getCpuGlobalJit
public boolean getCpuGlobalJit()CPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
bool cpu_global_jit = 7;- Specified by:
getCpuGlobalJitin interfaceOptimizerOptionsOrBuilder- Returns:
- The cpuGlobalJit.
-
setCpuGlobalJit
CPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
bool cpu_global_jit = 7;- Parameters:
value- The cpuGlobalJit to set.- Returns:
- This builder for chaining.
-
clearCpuGlobalJit
CPU code will be autoclustered only if global_jit_level >= ON_1 and either: - this flag is true, or - TF_XLA_FLAGS contains --tf_xla_cpu_global_jit=true.
bool cpu_global_jit = 7;- Returns:
- This builder for chaining.
-
setUnknownFields
public final OptimizerOptions.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-
mergeUnknownFields
public final OptimizerOptions.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
-