org.tensorflow.framework.OptimizerOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto Show documentation
Show all versions of proto Show documentation
Java API for TensorFlow protocol buffers.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/config.proto
package org.tensorflow.framework;
/**
*
* Options passed to the graph optimizer
*
*
* Protobuf type {@code tensorflow.OptimizerOptions}
*/
public final class OptimizerOptions extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.OptimizerOptions)
OptimizerOptionsOrBuilder {
private static final long serialVersionUID = 0L;
// Use OptimizerOptions.newBuilder() to construct.
private OptimizerOptions(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private OptimizerOptions() {
doCommonSubexpressionElimination_ = false;
doConstantFolding_ = false;
maxFoldedConstantInBytes_ = 0L;
doFunctionInlining_ = false;
optLevel_ = 0;
globalJitLevel_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private OptimizerOptions(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 8: {
doCommonSubexpressionElimination_ = input.readBool();
break;
}
case 16: {
doConstantFolding_ = input.readBool();
break;
}
case 24: {
int rawValue = input.readEnum();
optLevel_ = rawValue;
break;
}
case 32: {
doFunctionInlining_ = input.readBool();
break;
}
case 40: {
int rawValue = input.readEnum();
globalJitLevel_ = rawValue;
break;
}
case 48: {
maxFoldedConstantInBytes_ = input.readInt64();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.OptimizerOptions.class, org.tensorflow.framework.OptimizerOptions.Builder.class);
}
/**
*
* Optimization level
*
*
* Protobuf enum {@code tensorflow.OptimizerOptions.Level}
*/
public enum Level
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* L1 is the default level.
* Optimization performed at L1 :
* 1. Common subexpression elimination
* 2. Constant folding
*
*
* L1 = 0;
*/
L1(0),
/**
*
* No optimizations
*
*
* L0 = -1;
*/
L0(-1),
UNRECOGNIZED(-1),
;
/**
*
* L1 is the default level.
* Optimization performed at L1 :
* 1. Common subexpression elimination
* 2. Constant folding
*
*
* L1 = 0;
*/
public static final int L1_VALUE = 0;
/**
*
* No optimizations
*
*
* L0 = -1;
*/
public static final int L0_VALUE = -1;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Level valueOf(int value) {
return forNumber(value);
}
public static Level forNumber(int value) {
switch (value) {
case 0: return L1;
case -1: return L0;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Level> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Level findValueByNumber(int number) {
return Level.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.tensorflow.framework.OptimizerOptions.getDescriptor().getEnumTypes().get(0);
}
private static final Level[] VALUES = values();
public static Level valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Level(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.Level)
}
/**
*
* Control the use of the compiler/jit. Experimental.
*
*
* Protobuf enum {@code tensorflow.OptimizerOptions.GlobalJitLevel}
*/
public enum GlobalJitLevel
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Default setting ("off" now, but later expected to be "on")
*
*
* DEFAULT = 0;
*/
DEFAULT(0),
/**
* OFF = -1;
*/
OFF(-1),
/**
*
* The following settings turn on compilation, with higher values being
* more aggressive. Higher values may reduce opportunities for parallelism
* and may use more memory. (At present, there is no distinction, but this
* is expected to change.)
*
*
* ON_1 = 1;
*/
ON_1(1),
/**
* ON_2 = 2;
*/
ON_2(2),
UNRECOGNIZED(-1),
;
/**
*
* Default setting ("off" now, but later expected to be "on")
*
*
* DEFAULT = 0;
*/
public static final int DEFAULT_VALUE = 0;
/**
* OFF = -1;
*/
public static final int OFF_VALUE = -1;
/**
*
* The following settings turn on compilation, with higher values being
* more aggressive. Higher values may reduce opportunities for parallelism
* and may use more memory. (At present, there is no distinction, but this
* is expected to change.)
*
*
* ON_1 = 1;
*/
public static final int ON_1_VALUE = 1;
/**
* ON_2 = 2;
*/
public static final int ON_2_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static GlobalJitLevel valueOf(int value) {
return forNumber(value);
}
public static GlobalJitLevel forNumber(int value) {
switch (value) {
case 0: return DEFAULT;
case -1: return OFF;
case 1: return ON_1;
case 2: return ON_2;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
GlobalJitLevel> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public GlobalJitLevel findValueByNumber(int number) {
return GlobalJitLevel.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.tensorflow.framework.OptimizerOptions.getDescriptor().getEnumTypes().get(1);
}
private static final GlobalJitLevel[] VALUES = values();
public static GlobalJitLevel valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private GlobalJitLevel(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:tensorflow.OptimizerOptions.GlobalJitLevel)
}
public static final int DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER = 1;
private boolean doCommonSubexpressionElimination_;
/**
*
* If true, optimize the graph using common subexpression elimination.
*
*
* bool do_common_subexpression_elimination = 1;
*/
public boolean getDoCommonSubexpressionElimination() {
return doCommonSubexpressionElimination_;
}
public static final int DO_CONSTANT_FOLDING_FIELD_NUMBER = 2;
private boolean doConstantFolding_;
/**
*
* If true, perform constant folding optimization on the graph.
*
*
* bool do_constant_folding = 2;
*/
public boolean getDoConstantFolding() {
return doConstantFolding_;
}
public static final int MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER = 6;
private long maxFoldedConstantInBytes_;
/**
*
* 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;
*/
public long getMaxFoldedConstantInBytes() {
return maxFoldedConstantInBytes_;
}
public static final int DO_FUNCTION_INLINING_FIELD_NUMBER = 4;
private boolean doFunctionInlining_;
/**
*
* If true, perform function inlining on the graph.
*
*
* bool do_function_inlining = 4;
*/
public boolean getDoFunctionInlining() {
return doFunctionInlining_;
}
public static final int OPT_LEVEL_FIELD_NUMBER = 3;
private int optLevel_;
/**
*
* 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;
*/
public int getOptLevelValue() {
return optLevel_;
}
/**
*
* 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;
*/
public org.tensorflow.framework.OptimizerOptions.Level getOptLevel() {
org.tensorflow.framework.OptimizerOptions.Level result = org.tensorflow.framework.OptimizerOptions.Level.valueOf(optLevel_);
return result == null ? org.tensorflow.framework.OptimizerOptions.Level.UNRECOGNIZED : result;
}
public static final int GLOBAL_JIT_LEVEL_FIELD_NUMBER = 5;
private int globalJitLevel_;
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public int getGlobalJitLevelValue() {
return globalJitLevel_;
}
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public org.tensorflow.framework.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() {
org.tensorflow.framework.OptimizerOptions.GlobalJitLevel result = org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.valueOf(globalJitLevel_);
return result == null ? org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (doCommonSubexpressionElimination_ != false) {
output.writeBool(1, doCommonSubexpressionElimination_);
}
if (doConstantFolding_ != false) {
output.writeBool(2, doConstantFolding_);
}
if (optLevel_ != org.tensorflow.framework.OptimizerOptions.Level.L1.getNumber()) {
output.writeEnum(3, optLevel_);
}
if (doFunctionInlining_ != false) {
output.writeBool(4, doFunctionInlining_);
}
if (globalJitLevel_ != org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) {
output.writeEnum(5, globalJitLevel_);
}
if (maxFoldedConstantInBytes_ != 0L) {
output.writeInt64(6, maxFoldedConstantInBytes_);
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (doCommonSubexpressionElimination_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(1, doCommonSubexpressionElimination_);
}
if (doConstantFolding_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(2, doConstantFolding_);
}
if (optLevel_ != org.tensorflow.framework.OptimizerOptions.Level.L1.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, optLevel_);
}
if (doFunctionInlining_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(4, doFunctionInlining_);
}
if (globalJitLevel_ != org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, globalJitLevel_);
}
if (maxFoldedConstantInBytes_ != 0L) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, maxFoldedConstantInBytes_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.tensorflow.framework.OptimizerOptions)) {
return super.equals(obj);
}
org.tensorflow.framework.OptimizerOptions other = (org.tensorflow.framework.OptimizerOptions) obj;
boolean result = true;
result = result && (getDoCommonSubexpressionElimination()
== other.getDoCommonSubexpressionElimination());
result = result && (getDoConstantFolding()
== other.getDoConstantFolding());
result = result && (getMaxFoldedConstantInBytes()
== other.getMaxFoldedConstantInBytes());
result = result && (getDoFunctionInlining()
== other.getDoFunctionInlining());
result = result && optLevel_ == other.optLevel_;
result = result && globalJitLevel_ == other.globalJitLevel_;
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + DO_COMMON_SUBEXPRESSION_ELIMINATION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDoCommonSubexpressionElimination());
hash = (37 * hash) + DO_CONSTANT_FOLDING_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDoConstantFolding());
hash = (37 * hash) + MAX_FOLDED_CONSTANT_IN_BYTES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getMaxFoldedConstantInBytes());
hash = (37 * hash) + DO_FUNCTION_INLINING_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDoFunctionInlining());
hash = (37 * hash) + OPT_LEVEL_FIELD_NUMBER;
hash = (53 * hash) + optLevel_;
hash = (37 * hash) + GLOBAL_JIT_LEVEL_FIELD_NUMBER;
hash = (53 * hash) + globalJitLevel_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static org.tensorflow.framework.OptimizerOptions parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.tensorflow.framework.OptimizerOptions parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.OptimizerOptions parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(org.tensorflow.framework.OptimizerOptions prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Options passed to the graph optimizer
*
*
* Protobuf type {@code tensorflow.OptimizerOptions}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tensorflow.OptimizerOptions)
org.tensorflow.framework.OptimizerOptionsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.OptimizerOptions.class, org.tensorflow.framework.OptimizerOptions.Builder.class);
}
// Construct using org.tensorflow.framework.OptimizerOptions.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
doCommonSubexpressionElimination_ = false;
doConstantFolding_ = false;
maxFoldedConstantInBytes_ = 0L;
doFunctionInlining_ = false;
optLevel_ = 0;
globalJitLevel_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.tensorflow.framework.ConfigProtos.internal_static_tensorflow_OptimizerOptions_descriptor;
}
public org.tensorflow.framework.OptimizerOptions getDefaultInstanceForType() {
return org.tensorflow.framework.OptimizerOptions.getDefaultInstance();
}
public org.tensorflow.framework.OptimizerOptions build() {
org.tensorflow.framework.OptimizerOptions result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.tensorflow.framework.OptimizerOptions buildPartial() {
org.tensorflow.framework.OptimizerOptions result = new org.tensorflow.framework.OptimizerOptions(this);
result.doCommonSubexpressionElimination_ = doCommonSubexpressionElimination_;
result.doConstantFolding_ = doConstantFolding_;
result.maxFoldedConstantInBytes_ = maxFoldedConstantInBytes_;
result.doFunctionInlining_ = doFunctionInlining_;
result.optLevel_ = optLevel_;
result.globalJitLevel_ = globalJitLevel_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof org.tensorflow.framework.OptimizerOptions) {
return mergeFrom((org.tensorflow.framework.OptimizerOptions)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.tensorflow.framework.OptimizerOptions other) {
if (other == org.tensorflow.framework.OptimizerOptions.getDefaultInstance()) return this;
if (other.getDoCommonSubexpressionElimination() != false) {
setDoCommonSubexpressionElimination(other.getDoCommonSubexpressionElimination());
}
if (other.getDoConstantFolding() != false) {
setDoConstantFolding(other.getDoConstantFolding());
}
if (other.getMaxFoldedConstantInBytes() != 0L) {
setMaxFoldedConstantInBytes(other.getMaxFoldedConstantInBytes());
}
if (other.getDoFunctionInlining() != false) {
setDoFunctionInlining(other.getDoFunctionInlining());
}
if (other.optLevel_ != 0) {
setOptLevelValue(other.getOptLevelValue());
}
if (other.globalJitLevel_ != 0) {
setGlobalJitLevelValue(other.getGlobalJitLevelValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.tensorflow.framework.OptimizerOptions parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.tensorflow.framework.OptimizerOptions) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private boolean doCommonSubexpressionElimination_ ;
/**
*
* If true, optimize the graph using common subexpression elimination.
*
*
* bool do_common_subexpression_elimination = 1;
*/
public boolean getDoCommonSubexpressionElimination() {
return doCommonSubexpressionElimination_;
}
/**
*
* If true, optimize the graph using common subexpression elimination.
*
*
* bool do_common_subexpression_elimination = 1;
*/
public Builder setDoCommonSubexpressionElimination(boolean value) {
doCommonSubexpressionElimination_ = value;
onChanged();
return this;
}
/**
*
* If true, optimize the graph using common subexpression elimination.
*
*
* bool do_common_subexpression_elimination = 1;
*/
public Builder clearDoCommonSubexpressionElimination() {
doCommonSubexpressionElimination_ = false;
onChanged();
return this;
}
private boolean doConstantFolding_ ;
/**
*
* If true, perform constant folding optimization on the graph.
*
*
* bool do_constant_folding = 2;
*/
public boolean getDoConstantFolding() {
return doConstantFolding_;
}
/**
*
* If true, perform constant folding optimization on the graph.
*
*
* bool do_constant_folding = 2;
*/
public Builder setDoConstantFolding(boolean value) {
doConstantFolding_ = value;
onChanged();
return this;
}
/**
*
* If true, perform constant folding optimization on the graph.
*
*
* bool do_constant_folding = 2;
*/
public Builder clearDoConstantFolding() {
doConstantFolding_ = false;
onChanged();
return this;
}
private long maxFoldedConstantInBytes_ ;
/**
*
* 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;
*/
public long getMaxFoldedConstantInBytes() {
return maxFoldedConstantInBytes_;
}
/**
*
* 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;
*/
public Builder setMaxFoldedConstantInBytes(long value) {
maxFoldedConstantInBytes_ = value;
onChanged();
return this;
}
/**
*
* 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;
*/
public Builder clearMaxFoldedConstantInBytes() {
maxFoldedConstantInBytes_ = 0L;
onChanged();
return this;
}
private boolean doFunctionInlining_ ;
/**
*
* If true, perform function inlining on the graph.
*
*
* bool do_function_inlining = 4;
*/
public boolean getDoFunctionInlining() {
return doFunctionInlining_;
}
/**
*
* If true, perform function inlining on the graph.
*
*
* bool do_function_inlining = 4;
*/
public Builder setDoFunctionInlining(boolean value) {
doFunctionInlining_ = value;
onChanged();
return this;
}
/**
*
* If true, perform function inlining on the graph.
*
*
* bool do_function_inlining = 4;
*/
public Builder clearDoFunctionInlining() {
doFunctionInlining_ = false;
onChanged();
return this;
}
private int optLevel_ = 0;
/**
*
* 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;
*/
public int getOptLevelValue() {
return optLevel_;
}
/**
*
* 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;
*/
public Builder setOptLevelValue(int value) {
optLevel_ = value;
onChanged();
return this;
}
/**
*
* 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;
*/
public org.tensorflow.framework.OptimizerOptions.Level getOptLevel() {
org.tensorflow.framework.OptimizerOptions.Level result = org.tensorflow.framework.OptimizerOptions.Level.valueOf(optLevel_);
return result == null ? org.tensorflow.framework.OptimizerOptions.Level.UNRECOGNIZED : result;
}
/**
*
* 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;
*/
public Builder setOptLevel(org.tensorflow.framework.OptimizerOptions.Level value) {
if (value == null) {
throw new NullPointerException();
}
optLevel_ = value.getNumber();
onChanged();
return this;
}
/**
*
* 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;
*/
public Builder clearOptLevel() {
optLevel_ = 0;
onChanged();
return this;
}
private int globalJitLevel_ = 0;
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public int getGlobalJitLevelValue() {
return globalJitLevel_;
}
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public Builder setGlobalJitLevelValue(int value) {
globalJitLevel_ = value;
onChanged();
return this;
}
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public org.tensorflow.framework.OptimizerOptions.GlobalJitLevel getGlobalJitLevel() {
org.tensorflow.framework.OptimizerOptions.GlobalJitLevel result = org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.valueOf(globalJitLevel_);
return result == null ? org.tensorflow.framework.OptimizerOptions.GlobalJitLevel.UNRECOGNIZED : result;
}
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public Builder setGlobalJitLevel(org.tensorflow.framework.OptimizerOptions.GlobalJitLevel value) {
if (value == null) {
throw new NullPointerException();
}
globalJitLevel_ = value.getNumber();
onChanged();
return this;
}
/**
* .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
*/
public Builder clearGlobalJitLevel() {
globalJitLevel_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:tensorflow.OptimizerOptions)
}
// @@protoc_insertion_point(class_scope:tensorflow.OptimizerOptions)
private static final org.tensorflow.framework.OptimizerOptions DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.tensorflow.framework.OptimizerOptions();
}
public static org.tensorflow.framework.OptimizerOptions getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public OptimizerOptions parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new OptimizerOptions(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.tensorflow.framework.OptimizerOptions getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}