org.tensorflow.framework.RewriterConfig 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/rewriter_config.proto
package org.tensorflow.framework;
/**
*
* Graph rewriting is experimental and subject to change, not covered by any
* API stability guarantees.
*
*
* Protobuf type {@code tensorflow.RewriterConfig}
*/
public final class RewriterConfig extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig)
RewriterConfigOrBuilder {
private static final long serialVersionUID = 0L;
// Use RewriterConfig.newBuilder() to construct.
private RewriterConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RewriterConfig() {
layoutOptimizer_ = 0;
constantFolding_ = 0;
shapeOptimization_ = 0;
remapping_ = 0;
arithmeticOptimization_ = 0;
dependencyOptimization_ = 0;
loopOptimization_ = 0;
functionOptimization_ = 0;
debugStripper_ = 0;
disableModelPruning_ = false;
scopedAllocatorOptimization_ = 0;
pinToHostOptimization_ = 0;
disableMetaOptimizer_ = false;
metaOptimizerIterations_ = 0;
minGraphNodes_ = 0;
memoryOptimization_ = 0;
memoryOptimizerTargetNodeNameScope_ = "";
optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY;
customOptimizers_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RewriterConfig(
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: {
int rawValue = input.readEnum();
layoutOptimizer_ = rawValue;
break;
}
case 16: {
disableModelPruning_ = input.readBool();
break;
}
case 24: {
int rawValue = input.readEnum();
constantFolding_ = rawValue;
break;
}
case 32: {
int rawValue = input.readEnum();
memoryOptimization_ = rawValue;
break;
}
case 42: {
org.tensorflow.framework.AutoParallelOptions.Builder subBuilder = null;
if (autoParallel_ != null) {
subBuilder = autoParallel_.toBuilder();
}
autoParallel_ = input.readMessage(org.tensorflow.framework.AutoParallelOptions.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(autoParallel_);
autoParallel_ = subBuilder.buildPartial();
}
break;
}
case 50: {
java.lang.String s = input.readStringRequireUtf8();
memoryOptimizerTargetNodeNameScope_ = s;
break;
}
case 56: {
int rawValue = input.readEnum();
arithmeticOptimization_ = rawValue;
break;
}
case 64: {
int rawValue = input.readEnum();
dependencyOptimization_ = rawValue;
break;
}
case 72: {
int rawValue = input.readEnum();
loopOptimization_ = rawValue;
break;
}
case 80: {
int rawValue = input.readEnum();
functionOptimization_ = rawValue;
break;
}
case 88: {
int rawValue = input.readEnum();
debugStripper_ = rawValue;
break;
}
case 96: {
int rawValue = input.readEnum();
metaOptimizerIterations_ = rawValue;
break;
}
case 104: {
int rawValue = input.readEnum();
shapeOptimization_ = rawValue;
break;
}
case 112: {
int rawValue = input.readEnum();
remapping_ = rawValue;
break;
}
case 120: {
int rawValue = input.readEnum();
scopedAllocatorOptimization_ = rawValue;
break;
}
case 130: {
org.tensorflow.framework.ScopedAllocatorOptions.Builder subBuilder = null;
if (scopedAllocatorOpts_ != null) {
subBuilder = scopedAllocatorOpts_.toBuilder();
}
scopedAllocatorOpts_ = input.readMessage(org.tensorflow.framework.ScopedAllocatorOptions.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(scopedAllocatorOpts_);
scopedAllocatorOpts_ = subBuilder.buildPartial();
}
break;
}
case 136: {
minGraphNodes_ = input.readInt32();
break;
}
case 144: {
int rawValue = input.readEnum();
pinToHostOptimization_ = rawValue;
break;
}
case 152: {
disableMetaOptimizer_ = input.readBool();
break;
}
case 802: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00080000) == 0x00080000)) {
optimizers_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00080000;
}
optimizers_.add(s);
break;
}
case 1602: {
if (!((mutable_bitField0_ & 0x00100000) == 0x00100000)) {
customOptimizers_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00100000;
}
customOptimizers_.add(
input.readMessage(org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.parser(), extensionRegistry));
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 {
if (((mutable_bitField0_ & 0x00080000) == 0x00080000)) {
optimizers_ = optimizers_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00100000) == 0x00100000)) {
customOptimizers_ = java.util.Collections.unmodifiableList(customOptimizers_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.RewriterConfig.class, org.tensorflow.framework.RewriterConfig.Builder.class);
}
/**
* Protobuf enum {@code tensorflow.RewriterConfig.Toggle}
*/
public enum Toggle
implements com.google.protobuf.ProtocolMessageEnum {
/**
* DEFAULT = 0;
*/
DEFAULT(0),
/**
* ON = 1;
*/
ON(1),
/**
* OFF = 2;
*/
OFF(2),
/**
*
* Enable some aggressive optimizations that use assumptions that TF graphs
* may break. For example, assume the shape of a placeholder matches its
* actual feed.
*
*
* AGGRESSIVE = 3;
*/
AGGRESSIVE(3),
UNRECOGNIZED(-1),
;
/**
* DEFAULT = 0;
*/
public static final int DEFAULT_VALUE = 0;
/**
* ON = 1;
*/
public static final int ON_VALUE = 1;
/**
* OFF = 2;
*/
public static final int OFF_VALUE = 2;
/**
*
* Enable some aggressive optimizations that use assumptions that TF graphs
* may break. For example, assume the shape of a placeholder matches its
* actual feed.
*
*
* AGGRESSIVE = 3;
*/
public static final int AGGRESSIVE_VALUE = 3;
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 Toggle valueOf(int value) {
return forNumber(value);
}
public static Toggle forNumber(int value) {
switch (value) {
case 0: return DEFAULT;
case 1: return ON;
case 2: return OFF;
case 3: return AGGRESSIVE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Toggle> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Toggle findValueByNumber(int number) {
return Toggle.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.RewriterConfig.getDescriptor().getEnumTypes().get(0);
}
private static final Toggle[] VALUES = values();
public static Toggle 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 Toggle(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.Toggle)
}
/**
*
* Enum controlling the number of times to run optimizers. The default is to
* run them once.
*
*
* Protobuf enum {@code tensorflow.RewriterConfig.NumIterationsType}
*/
public enum NumIterationsType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* DEFAULT_NUM_ITERS = 0;
*/
DEFAULT_NUM_ITERS(0),
/**
* ONE = 1;
*/
ONE(1),
/**
* TWO = 2;
*/
TWO(2),
UNRECOGNIZED(-1),
;
/**
* DEFAULT_NUM_ITERS = 0;
*/
public static final int DEFAULT_NUM_ITERS_VALUE = 0;
/**
* ONE = 1;
*/
public static final int ONE_VALUE = 1;
/**
* TWO = 2;
*/
public static final int TWO_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 NumIterationsType valueOf(int value) {
return forNumber(value);
}
public static NumIterationsType forNumber(int value) {
switch (value) {
case 0: return DEFAULT_NUM_ITERS;
case 1: return ONE;
case 2: return TWO;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
NumIterationsType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public NumIterationsType findValueByNumber(int number) {
return NumIterationsType.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.RewriterConfig.getDescriptor().getEnumTypes().get(1);
}
private static final NumIterationsType[] VALUES = values();
public static NumIterationsType 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 NumIterationsType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.NumIterationsType)
}
/**
* Protobuf enum {@code tensorflow.RewriterConfig.MemOptType}
*/
public enum MemOptType
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* The default setting (SCHEDULING and SWAPPING HEURISTICS only)
*
*
* DEFAULT_MEM_OPT = 0;
*/
DEFAULT_MEM_OPT(0),
/**
*
* Disabled in the meta-optimizer.
*
*
* NO_MEM_OPT = 1;
*/
NO_MEM_OPT(1),
/**
*
* Driven by manual op-level annotations.
*
*
* MANUAL = 2;
*/
MANUAL(2),
/**
*
* Swapping heuristic will move a tensor from the GPU to the CPU and move
* it back when needed to reduce peak memory usage.
*
*
* SWAPPING_HEURISTICS = 4;
*/
SWAPPING_HEURISTICS(4),
/**
*
* Recomputation heuristics will recompute ops (such as Relu activation)
* during backprop instead of storing them, reducing peak memory usage.
*
*
* RECOMPUTATION_HEURISTICS = 5;
*/
RECOMPUTATION_HEURISTICS(5),
/**
*
* Scheduling will split big ops such as AddN and try to enforce a schedule
* of the new computations that decreases peak memory usage.
*
*
* SCHEDULING_HEURISTICS = 6;
*/
SCHEDULING_HEURISTICS(6),
/**
*
* Use any combination of swapping and recomputation heuristics.
*
*
* HEURISTICS = 3;
*/
HEURISTICS(3),
UNRECOGNIZED(-1),
;
/**
*
* The default setting (SCHEDULING and SWAPPING HEURISTICS only)
*
*
* DEFAULT_MEM_OPT = 0;
*/
public static final int DEFAULT_MEM_OPT_VALUE = 0;
/**
*
* Disabled in the meta-optimizer.
*
*
* NO_MEM_OPT = 1;
*/
public static final int NO_MEM_OPT_VALUE = 1;
/**
*
* Driven by manual op-level annotations.
*
*
* MANUAL = 2;
*/
public static final int MANUAL_VALUE = 2;
/**
*
* Swapping heuristic will move a tensor from the GPU to the CPU and move
* it back when needed to reduce peak memory usage.
*
*
* SWAPPING_HEURISTICS = 4;
*/
public static final int SWAPPING_HEURISTICS_VALUE = 4;
/**
*
* Recomputation heuristics will recompute ops (such as Relu activation)
* during backprop instead of storing them, reducing peak memory usage.
*
*
* RECOMPUTATION_HEURISTICS = 5;
*/
public static final int RECOMPUTATION_HEURISTICS_VALUE = 5;
/**
*
* Scheduling will split big ops such as AddN and try to enforce a schedule
* of the new computations that decreases peak memory usage.
*
*
* SCHEDULING_HEURISTICS = 6;
*/
public static final int SCHEDULING_HEURISTICS_VALUE = 6;
/**
*
* Use any combination of swapping and recomputation heuristics.
*
*
* HEURISTICS = 3;
*/
public static final int HEURISTICS_VALUE = 3;
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 MemOptType valueOf(int value) {
return forNumber(value);
}
public static MemOptType forNumber(int value) {
switch (value) {
case 0: return DEFAULT_MEM_OPT;
case 1: return NO_MEM_OPT;
case 2: return MANUAL;
case 4: return SWAPPING_HEURISTICS;
case 5: return RECOMPUTATION_HEURISTICS;
case 6: return SCHEDULING_HEURISTICS;
case 3: return HEURISTICS;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
MemOptType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public MemOptType findValueByNumber(int number) {
return MemOptType.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.RewriterConfig.getDescriptor().getEnumTypes().get(2);
}
private static final MemOptType[] VALUES = values();
public static MemOptType 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 MemOptType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:tensorflow.RewriterConfig.MemOptType)
}
public interface CustomGraphOptimizerOrBuilder extends
// @@protoc_insertion_point(interface_extends:tensorflow.RewriterConfig.CustomGraphOptimizer)
com.google.protobuf.MessageOrBuilder {
/**
* string name = 1;
*/
java.lang.String getName();
/**
* string name = 1;
*/
com.google.protobuf.ByteString
getNameBytes();
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
int getParameterMapCount();
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
boolean containsParameterMap(
java.lang.String key);
/**
* Use {@link #getParameterMapMap()} instead.
*/
@java.lang.Deprecated
java.util.Map
getParameterMap();
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
java.util.Map
getParameterMapMap();
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
org.tensorflow.framework.AttrValue getParameterMapOrDefault(
java.lang.String key,
org.tensorflow.framework.AttrValue defaultValue);
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
org.tensorflow.framework.AttrValue getParameterMapOrThrow(
java.lang.String key);
}
/**
*
* Message to describe custom graph optimizer and its parameters
*
*
* Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer}
*/
public static final class CustomGraphOptimizer extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:tensorflow.RewriterConfig.CustomGraphOptimizer)
CustomGraphOptimizerOrBuilder {
private static final long serialVersionUID = 0L;
// Use CustomGraphOptimizer.newBuilder() to construct.
private CustomGraphOptimizer(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CustomGraphOptimizer() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private CustomGraphOptimizer(
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 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
parameterMap_ = com.google.protobuf.MapField.newMapField(
ParameterMapDefaultEntryHolder.defaultEntry);
mutable_bitField0_ |= 0x00000002;
}
com.google.protobuf.MapEntry
parameterMap__ = input.readMessage(
ParameterMapDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
parameterMap_.getMutableMap().put(
parameterMap__.getKey(), parameterMap__.getValue());
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.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetParameterMap();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder.class);
}
private int bitField0_;
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* string name = 1;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PARAMETER_MAP_FIELD_NUMBER = 2;
private static final class ParameterMapDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, org.tensorflow.framework.AttrValue> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_ParameterMapEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
org.tensorflow.framework.AttrValue.getDefaultInstance());
}
private com.google.protobuf.MapField<
java.lang.String, org.tensorflow.framework.AttrValue> parameterMap_;
private com.google.protobuf.MapField
internalGetParameterMap() {
if (parameterMap_ == null) {
return com.google.protobuf.MapField.emptyMapField(
ParameterMapDefaultEntryHolder.defaultEntry);
}
return parameterMap_;
}
public int getParameterMapCount() {
return internalGetParameterMap().getMap().size();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public boolean containsParameterMap(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetParameterMap().getMap().containsKey(key);
}
/**
* Use {@link #getParameterMapMap()} instead.
*/
@java.lang.Deprecated
public java.util.Map getParameterMap() {
return getParameterMapMap();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public java.util.Map getParameterMapMap() {
return internalGetParameterMap().getMap();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public org.tensorflow.framework.AttrValue getParameterMapOrDefault(
java.lang.String key,
org.tensorflow.framework.AttrValue defaultValue) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map map =
internalGetParameterMap().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public org.tensorflow.framework.AttrValue getParameterMapOrThrow(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map map =
internalGetParameterMap().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
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 (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetParameterMap(),
ParameterMapDefaultEntryHolder.defaultEntry,
2);
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
for (java.util.Map.Entry entry
: internalGetParameterMap().getMap().entrySet()) {
com.google.protobuf.MapEntry
parameterMap__ = ParameterMapDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, parameterMap__);
}
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.RewriterConfig.CustomGraphOptimizer)) {
return super.equals(obj);
}
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer other = (org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer) obj;
boolean result = true;
result = result && getName()
.equals(other.getName());
result = result && internalGetParameterMap().equals(
other.internalGetParameterMap());
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) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
if (!internalGetParameterMap().getMap().isEmpty()) {
hash = (37 * hash) + PARAMETER_MAP_FIELD_NUMBER;
hash = (53 * hash) + internalGetParameterMap().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer 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.RewriterConfig.CustomGraphOptimizer 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;
}
/**
*
* Message to describe custom graph optimizer and its parameters
*
*
* Protobuf type {@code tensorflow.RewriterConfig.CustomGraphOptimizer}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig.CustomGraphOptimizer)
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetParameterMap();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(
int number) {
switch (number) {
case 2:
return internalGetMutableParameterMap();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.class, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder.class);
}
// Construct using org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.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();
name_ = "";
internalGetMutableParameterMap().clear();
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_CustomGraphOptimizer_descriptor;
}
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() {
return org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance();
}
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer build() {
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer buildPartial() {
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer result = new org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.name_ = name_;
result.parameterMap_ = internalGetParameterMap();
result.parameterMap_.makeImmutable();
result.bitField0_ = to_bitField0_;
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.RewriterConfig.CustomGraphOptimizer) {
return mergeFrom((org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer other) {
if (other == org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
internalGetMutableParameterMap().mergeFrom(
other.internalGetParameterMap());
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.RewriterConfig.CustomGraphOptimizer parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
* string name = 1;
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string name = 1;
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string name = 1;
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* string name = 1;
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* string name = 1;
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private com.google.protobuf.MapField<
java.lang.String, org.tensorflow.framework.AttrValue> parameterMap_;
private com.google.protobuf.MapField
internalGetParameterMap() {
if (parameterMap_ == null) {
return com.google.protobuf.MapField.emptyMapField(
ParameterMapDefaultEntryHolder.defaultEntry);
}
return parameterMap_;
}
private com.google.protobuf.MapField
internalGetMutableParameterMap() {
onChanged();;
if (parameterMap_ == null) {
parameterMap_ = com.google.protobuf.MapField.newMapField(
ParameterMapDefaultEntryHolder.defaultEntry);
}
if (!parameterMap_.isMutable()) {
parameterMap_ = parameterMap_.copy();
}
return parameterMap_;
}
public int getParameterMapCount() {
return internalGetParameterMap().getMap().size();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public boolean containsParameterMap(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetParameterMap().getMap().containsKey(key);
}
/**
* Use {@link #getParameterMapMap()} instead.
*/
@java.lang.Deprecated
public java.util.Map getParameterMap() {
return getParameterMapMap();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public java.util.Map getParameterMapMap() {
return internalGetParameterMap().getMap();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public org.tensorflow.framework.AttrValue getParameterMapOrDefault(
java.lang.String key,
org.tensorflow.framework.AttrValue defaultValue) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map map =
internalGetParameterMap().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public org.tensorflow.framework.AttrValue getParameterMapOrThrow(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map map =
internalGetParameterMap().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearParameterMap() {
internalGetMutableParameterMap().getMutableMap()
.clear();
return this;
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public Builder removeParameterMap(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
internalGetMutableParameterMap().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map
getMutableParameterMap() {
return internalGetMutableParameterMap().getMutableMap();
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public Builder putParameterMap(
java.lang.String key,
org.tensorflow.framework.AttrValue value) {
if (key == null) { throw new java.lang.NullPointerException(); }
if (value == null) { throw new java.lang.NullPointerException(); }
internalGetMutableParameterMap().getMutableMap()
.put(key, value);
return this;
}
/**
* map<string, .tensorflow.AttrValue> parameter_map = 2;
*/
public Builder putAllParameterMap(
java.util.Map values) {
internalGetMutableParameterMap().getMutableMap()
.putAll(values);
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.RewriterConfig.CustomGraphOptimizer)
}
// @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig.CustomGraphOptimizer)
private static final org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer();
}
public static org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public CustomGraphOptimizer parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new CustomGraphOptimizer(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.RewriterConfig.CustomGraphOptimizer getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int bitField0_;
public static final int LAYOUT_OPTIMIZER_FIELD_NUMBER = 1;
private int layoutOptimizer_;
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public int getLayoutOptimizerValue() {
return layoutOptimizer_;
}
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getLayoutOptimizer() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(layoutOptimizer_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int CONSTANT_FOLDING_FIELD_NUMBER = 3;
private int constantFolding_;
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public int getConstantFoldingValue() {
return constantFolding_;
}
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getConstantFolding() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(constantFolding_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int SHAPE_OPTIMIZATION_FIELD_NUMBER = 13;
private int shapeOptimization_;
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public int getShapeOptimizationValue() {
return shapeOptimization_;
}
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getShapeOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(shapeOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int REMAPPING_FIELD_NUMBER = 14;
private int remapping_;
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public int getRemappingValue() {
return remapping_;
}
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getRemapping() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(remapping_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int ARITHMETIC_OPTIMIZATION_FIELD_NUMBER = 7;
private int arithmeticOptimization_;
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public int getArithmeticOptimizationValue() {
return arithmeticOptimization_;
}
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getArithmeticOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(arithmeticOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int DEPENDENCY_OPTIMIZATION_FIELD_NUMBER = 8;
private int dependencyOptimization_;
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public int getDependencyOptimizationValue() {
return dependencyOptimization_;
}
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getDependencyOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(dependencyOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int LOOP_OPTIMIZATION_FIELD_NUMBER = 9;
private int loopOptimization_;
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public int getLoopOptimizationValue() {
return loopOptimization_;
}
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getLoopOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(loopOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int FUNCTION_OPTIMIZATION_FIELD_NUMBER = 10;
private int functionOptimization_;
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public int getFunctionOptimizationValue() {
return functionOptimization_;
}
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getFunctionOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(functionOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int DEBUG_STRIPPER_FIELD_NUMBER = 11;
private int debugStripper_;
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public int getDebugStripperValue() {
return debugStripper_;
}
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getDebugStripper() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(debugStripper_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int DISABLE_MODEL_PRUNING_FIELD_NUMBER = 2;
private boolean disableModelPruning_;
/**
*
* If true, don't remove unnecessary ops from the graph
*
*
* bool disable_model_pruning = 2;
*/
public boolean getDisableModelPruning() {
return disableModelPruning_;
}
public static final int SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER = 15;
private int scopedAllocatorOptimization_;
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public int getScopedAllocatorOptimizationValue() {
return scopedAllocatorOptimization_;
}
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getScopedAllocatorOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(scopedAllocatorOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER = 18;
private int pinToHostOptimization_;
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public int getPinToHostOptimizationValue() {
return pinToHostOptimization_;
}
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getPinToHostOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(pinToHostOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
public static final int DISABLE_META_OPTIMIZER_FIELD_NUMBER = 19;
private boolean disableMetaOptimizer_;
/**
*
* Disable the entire meta optimizer (off by default).
*
*
* bool disable_meta_optimizer = 19;
*/
public boolean getDisableMetaOptimizer() {
return disableMetaOptimizer_;
}
public static final int META_OPTIMIZER_ITERATIONS_FIELD_NUMBER = 12;
private int metaOptimizerIterations_;
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public int getMetaOptimizerIterationsValue() {
return metaOptimizerIterations_;
}
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public org.tensorflow.framework.RewriterConfig.NumIterationsType getMetaOptimizerIterations() {
org.tensorflow.framework.RewriterConfig.NumIterationsType result = org.tensorflow.framework.RewriterConfig.NumIterationsType.valueOf(metaOptimizerIterations_);
return result == null ? org.tensorflow.framework.RewriterConfig.NumIterationsType.UNRECOGNIZED : result;
}
public static final int MIN_GRAPH_NODES_FIELD_NUMBER = 17;
private int minGraphNodes_;
/**
*
* The minimum number of nodes in a graph to optimizer. For smaller graphs,
* optimization is skipped.
* 0 means the system picks an appropriate number.
* < 0 means do not skip optimization.
*
*
* int32 min_graph_nodes = 17;
*/
public int getMinGraphNodes() {
return minGraphNodes_;
}
public static final int MEMORY_OPTIMIZATION_FIELD_NUMBER = 4;
private int memoryOptimization_;
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public int getMemoryOptimizationValue() {
return memoryOptimization_;
}
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public org.tensorflow.framework.RewriterConfig.MemOptType getMemoryOptimization() {
org.tensorflow.framework.RewriterConfig.MemOptType result = org.tensorflow.framework.RewriterConfig.MemOptType.valueOf(memoryOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.MemOptType.UNRECOGNIZED : result;
}
public static final int MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER = 6;
private volatile java.lang.Object memoryOptimizerTargetNodeNameScope_;
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public java.lang.String getMemoryOptimizerTargetNodeNameScope() {
java.lang.Object ref = memoryOptimizerTargetNodeNameScope_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memoryOptimizerTargetNodeNameScope_ = s;
return s;
}
}
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public com.google.protobuf.ByteString
getMemoryOptimizerTargetNodeNameScopeBytes() {
java.lang.Object ref = memoryOptimizerTargetNodeNameScope_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
memoryOptimizerTargetNodeNameScope_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int AUTO_PARALLEL_FIELD_NUMBER = 5;
private org.tensorflow.framework.AutoParallelOptions autoParallel_;
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public boolean hasAutoParallel() {
return autoParallel_ != null;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public org.tensorflow.framework.AutoParallelOptions getAutoParallel() {
return autoParallel_ == null ? org.tensorflow.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public org.tensorflow.framework.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() {
return getAutoParallel();
}
public static final int SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER = 16;
private org.tensorflow.framework.ScopedAllocatorOptions scopedAllocatorOpts_;
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public boolean hasScopedAllocatorOpts() {
return scopedAllocatorOpts_ != null;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public org.tensorflow.framework.ScopedAllocatorOptions getScopedAllocatorOpts() {
return scopedAllocatorOpts_ == null ? org.tensorflow.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public org.tensorflow.framework.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() {
return getScopedAllocatorOpts();
}
public static final int OPTIMIZERS_FIELD_NUMBER = 100;
private com.google.protobuf.LazyStringList optimizers_;
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public com.google.protobuf.ProtocolStringList
getOptimizersList() {
return optimizers_;
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public int getOptimizersCount() {
return optimizers_.size();
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public java.lang.String getOptimizers(int index) {
return optimizers_.get(index);
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public com.google.protobuf.ByteString
getOptimizersBytes(int index) {
return optimizers_.getByteString(index);
}
public static final int CUSTOM_OPTIMIZERS_FIELD_NUMBER = 200;
private java.util.List customOptimizers_;
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public java.util.List getCustomOptimizersList() {
return customOptimizers_;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public java.util.List extends org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder>
getCustomOptimizersOrBuilderList() {
return customOptimizers_;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public int getCustomOptimizersCount() {
return customOptimizers_.size();
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) {
return customOptimizers_.get(index);
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder(
int index) {
return customOptimizers_.get(index);
}
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 (layoutOptimizer_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(1, layoutOptimizer_);
}
if (disableModelPruning_ != false) {
output.writeBool(2, disableModelPruning_);
}
if (constantFolding_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(3, constantFolding_);
}
if (memoryOptimization_ != org.tensorflow.framework.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) {
output.writeEnum(4, memoryOptimization_);
}
if (autoParallel_ != null) {
output.writeMessage(5, getAutoParallel());
}
if (!getMemoryOptimizerTargetNodeNameScopeBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, memoryOptimizerTargetNodeNameScope_);
}
if (arithmeticOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(7, arithmeticOptimization_);
}
if (dependencyOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(8, dependencyOptimization_);
}
if (loopOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(9, loopOptimization_);
}
if (functionOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(10, functionOptimization_);
}
if (debugStripper_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(11, debugStripper_);
}
if (metaOptimizerIterations_ != org.tensorflow.framework.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) {
output.writeEnum(12, metaOptimizerIterations_);
}
if (shapeOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(13, shapeOptimization_);
}
if (remapping_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(14, remapping_);
}
if (scopedAllocatorOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(15, scopedAllocatorOptimization_);
}
if (scopedAllocatorOpts_ != null) {
output.writeMessage(16, getScopedAllocatorOpts());
}
if (minGraphNodes_ != 0) {
output.writeInt32(17, minGraphNodes_);
}
if (pinToHostOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
output.writeEnum(18, pinToHostOptimization_);
}
if (disableMetaOptimizer_ != false) {
output.writeBool(19, disableMetaOptimizer_);
}
for (int i = 0; i < optimizers_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 100, optimizers_.getRaw(i));
}
for (int i = 0; i < customOptimizers_.size(); i++) {
output.writeMessage(200, customOptimizers_.get(i));
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (layoutOptimizer_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, layoutOptimizer_);
}
if (disableModelPruning_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(2, disableModelPruning_);
}
if (constantFolding_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(3, constantFolding_);
}
if (memoryOptimization_ != org.tensorflow.framework.RewriterConfig.MemOptType.DEFAULT_MEM_OPT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(4, memoryOptimization_);
}
if (autoParallel_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, getAutoParallel());
}
if (!getMemoryOptimizerTargetNodeNameScopeBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, memoryOptimizerTargetNodeNameScope_);
}
if (arithmeticOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(7, arithmeticOptimization_);
}
if (dependencyOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(8, dependencyOptimization_);
}
if (loopOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(9, loopOptimization_);
}
if (functionOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(10, functionOptimization_);
}
if (debugStripper_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(11, debugStripper_);
}
if (metaOptimizerIterations_ != org.tensorflow.framework.RewriterConfig.NumIterationsType.DEFAULT_NUM_ITERS.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(12, metaOptimizerIterations_);
}
if (shapeOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(13, shapeOptimization_);
}
if (remapping_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(14, remapping_);
}
if (scopedAllocatorOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(15, scopedAllocatorOptimization_);
}
if (scopedAllocatorOpts_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(16, getScopedAllocatorOpts());
}
if (minGraphNodes_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(17, minGraphNodes_);
}
if (pinToHostOptimization_ != org.tensorflow.framework.RewriterConfig.Toggle.DEFAULT.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(18, pinToHostOptimization_);
}
if (disableMetaOptimizer_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(19, disableMetaOptimizer_);
}
{
int dataSize = 0;
for (int i = 0; i < optimizers_.size(); i++) {
dataSize += computeStringSizeNoTag(optimizers_.getRaw(i));
}
size += dataSize;
size += 2 * getOptimizersList().size();
}
for (int i = 0; i < customOptimizers_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(200, customOptimizers_.get(i));
}
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.RewriterConfig)) {
return super.equals(obj);
}
org.tensorflow.framework.RewriterConfig other = (org.tensorflow.framework.RewriterConfig) obj;
boolean result = true;
result = result && layoutOptimizer_ == other.layoutOptimizer_;
result = result && constantFolding_ == other.constantFolding_;
result = result && shapeOptimization_ == other.shapeOptimization_;
result = result && remapping_ == other.remapping_;
result = result && arithmeticOptimization_ == other.arithmeticOptimization_;
result = result && dependencyOptimization_ == other.dependencyOptimization_;
result = result && loopOptimization_ == other.loopOptimization_;
result = result && functionOptimization_ == other.functionOptimization_;
result = result && debugStripper_ == other.debugStripper_;
result = result && (getDisableModelPruning()
== other.getDisableModelPruning());
result = result && scopedAllocatorOptimization_ == other.scopedAllocatorOptimization_;
result = result && pinToHostOptimization_ == other.pinToHostOptimization_;
result = result && (getDisableMetaOptimizer()
== other.getDisableMetaOptimizer());
result = result && metaOptimizerIterations_ == other.metaOptimizerIterations_;
result = result && (getMinGraphNodes()
== other.getMinGraphNodes());
result = result && memoryOptimization_ == other.memoryOptimization_;
result = result && getMemoryOptimizerTargetNodeNameScope()
.equals(other.getMemoryOptimizerTargetNodeNameScope());
result = result && (hasAutoParallel() == other.hasAutoParallel());
if (hasAutoParallel()) {
result = result && getAutoParallel()
.equals(other.getAutoParallel());
}
result = result && (hasScopedAllocatorOpts() == other.hasScopedAllocatorOpts());
if (hasScopedAllocatorOpts()) {
result = result && getScopedAllocatorOpts()
.equals(other.getScopedAllocatorOpts());
}
result = result && getOptimizersList()
.equals(other.getOptimizersList());
result = result && getCustomOptimizersList()
.equals(other.getCustomOptimizersList());
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) + LAYOUT_OPTIMIZER_FIELD_NUMBER;
hash = (53 * hash) + layoutOptimizer_;
hash = (37 * hash) + CONSTANT_FOLDING_FIELD_NUMBER;
hash = (53 * hash) + constantFolding_;
hash = (37 * hash) + SHAPE_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + shapeOptimization_;
hash = (37 * hash) + REMAPPING_FIELD_NUMBER;
hash = (53 * hash) + remapping_;
hash = (37 * hash) + ARITHMETIC_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + arithmeticOptimization_;
hash = (37 * hash) + DEPENDENCY_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + dependencyOptimization_;
hash = (37 * hash) + LOOP_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + loopOptimization_;
hash = (37 * hash) + FUNCTION_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + functionOptimization_;
hash = (37 * hash) + DEBUG_STRIPPER_FIELD_NUMBER;
hash = (53 * hash) + debugStripper_;
hash = (37 * hash) + DISABLE_MODEL_PRUNING_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDisableModelPruning());
hash = (37 * hash) + SCOPED_ALLOCATOR_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + scopedAllocatorOptimization_;
hash = (37 * hash) + PIN_TO_HOST_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + pinToHostOptimization_;
hash = (37 * hash) + DISABLE_META_OPTIMIZER_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getDisableMetaOptimizer());
hash = (37 * hash) + META_OPTIMIZER_ITERATIONS_FIELD_NUMBER;
hash = (53 * hash) + metaOptimizerIterations_;
hash = (37 * hash) + MIN_GRAPH_NODES_FIELD_NUMBER;
hash = (53 * hash) + getMinGraphNodes();
hash = (37 * hash) + MEMORY_OPTIMIZATION_FIELD_NUMBER;
hash = (53 * hash) + memoryOptimization_;
hash = (37 * hash) + MEMORY_OPTIMIZER_TARGET_NODE_NAME_SCOPE_FIELD_NUMBER;
hash = (53 * hash) + getMemoryOptimizerTargetNodeNameScope().hashCode();
if (hasAutoParallel()) {
hash = (37 * hash) + AUTO_PARALLEL_FIELD_NUMBER;
hash = (53 * hash) + getAutoParallel().hashCode();
}
if (hasScopedAllocatorOpts()) {
hash = (37 * hash) + SCOPED_ALLOCATOR_OPTS_FIELD_NUMBER;
hash = (53 * hash) + getScopedAllocatorOpts().hashCode();
}
if (getOptimizersCount() > 0) {
hash = (37 * hash) + OPTIMIZERS_FIELD_NUMBER;
hash = (53 * hash) + getOptimizersList().hashCode();
}
if (getCustomOptimizersCount() > 0) {
hash = (37 * hash) + CUSTOM_OPTIMIZERS_FIELD_NUMBER;
hash = (53 * hash) + getCustomOptimizersList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.tensorflow.framework.RewriterConfig parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig 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.RewriterConfig parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig 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.RewriterConfig parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.tensorflow.framework.RewriterConfig parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.tensorflow.framework.RewriterConfig parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig 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.RewriterConfig parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig 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.RewriterConfig parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.tensorflow.framework.RewriterConfig 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.RewriterConfig 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;
}
/**
*
* Graph rewriting is experimental and subject to change, not covered by any
* API stability guarantees.
*
*
* Protobuf type {@code tensorflow.RewriterConfig}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:tensorflow.RewriterConfig)
org.tensorflow.framework.RewriterConfigOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.tensorflow.framework.RewriterConfig.class, org.tensorflow.framework.RewriterConfig.Builder.class);
}
// Construct using org.tensorflow.framework.RewriterConfig.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getCustomOptimizersFieldBuilder();
}
}
public Builder clear() {
super.clear();
layoutOptimizer_ = 0;
constantFolding_ = 0;
shapeOptimization_ = 0;
remapping_ = 0;
arithmeticOptimization_ = 0;
dependencyOptimization_ = 0;
loopOptimization_ = 0;
functionOptimization_ = 0;
debugStripper_ = 0;
disableModelPruning_ = false;
scopedAllocatorOptimization_ = 0;
pinToHostOptimization_ = 0;
disableMetaOptimizer_ = false;
metaOptimizerIterations_ = 0;
minGraphNodes_ = 0;
memoryOptimization_ = 0;
memoryOptimizerTargetNodeNameScope_ = "";
if (autoParallelBuilder_ == null) {
autoParallel_ = null;
} else {
autoParallel_ = null;
autoParallelBuilder_ = null;
}
if (scopedAllocatorOptsBuilder_ == null) {
scopedAllocatorOpts_ = null;
} else {
scopedAllocatorOpts_ = null;
scopedAllocatorOptsBuilder_ = null;
}
optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00080000);
if (customOptimizersBuilder_ == null) {
customOptimizers_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00100000);
} else {
customOptimizersBuilder_.clear();
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.tensorflow.framework.RewriterConfigProtos.internal_static_tensorflow_RewriterConfig_descriptor;
}
public org.tensorflow.framework.RewriterConfig getDefaultInstanceForType() {
return org.tensorflow.framework.RewriterConfig.getDefaultInstance();
}
public org.tensorflow.framework.RewriterConfig build() {
org.tensorflow.framework.RewriterConfig result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public org.tensorflow.framework.RewriterConfig buildPartial() {
org.tensorflow.framework.RewriterConfig result = new org.tensorflow.framework.RewriterConfig(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.layoutOptimizer_ = layoutOptimizer_;
result.constantFolding_ = constantFolding_;
result.shapeOptimization_ = shapeOptimization_;
result.remapping_ = remapping_;
result.arithmeticOptimization_ = arithmeticOptimization_;
result.dependencyOptimization_ = dependencyOptimization_;
result.loopOptimization_ = loopOptimization_;
result.functionOptimization_ = functionOptimization_;
result.debugStripper_ = debugStripper_;
result.disableModelPruning_ = disableModelPruning_;
result.scopedAllocatorOptimization_ = scopedAllocatorOptimization_;
result.pinToHostOptimization_ = pinToHostOptimization_;
result.disableMetaOptimizer_ = disableMetaOptimizer_;
result.metaOptimizerIterations_ = metaOptimizerIterations_;
result.minGraphNodes_ = minGraphNodes_;
result.memoryOptimization_ = memoryOptimization_;
result.memoryOptimizerTargetNodeNameScope_ = memoryOptimizerTargetNodeNameScope_;
if (autoParallelBuilder_ == null) {
result.autoParallel_ = autoParallel_;
} else {
result.autoParallel_ = autoParallelBuilder_.build();
}
if (scopedAllocatorOptsBuilder_ == null) {
result.scopedAllocatorOpts_ = scopedAllocatorOpts_;
} else {
result.scopedAllocatorOpts_ = scopedAllocatorOptsBuilder_.build();
}
if (((bitField0_ & 0x00080000) == 0x00080000)) {
optimizers_ = optimizers_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00080000);
}
result.optimizers_ = optimizers_;
if (customOptimizersBuilder_ == null) {
if (((bitField0_ & 0x00100000) == 0x00100000)) {
customOptimizers_ = java.util.Collections.unmodifiableList(customOptimizers_);
bitField0_ = (bitField0_ & ~0x00100000);
}
result.customOptimizers_ = customOptimizers_;
} else {
result.customOptimizers_ = customOptimizersBuilder_.build();
}
result.bitField0_ = to_bitField0_;
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.RewriterConfig) {
return mergeFrom((org.tensorflow.framework.RewriterConfig)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.tensorflow.framework.RewriterConfig other) {
if (other == org.tensorflow.framework.RewriterConfig.getDefaultInstance()) return this;
if (other.layoutOptimizer_ != 0) {
setLayoutOptimizerValue(other.getLayoutOptimizerValue());
}
if (other.constantFolding_ != 0) {
setConstantFoldingValue(other.getConstantFoldingValue());
}
if (other.shapeOptimization_ != 0) {
setShapeOptimizationValue(other.getShapeOptimizationValue());
}
if (other.remapping_ != 0) {
setRemappingValue(other.getRemappingValue());
}
if (other.arithmeticOptimization_ != 0) {
setArithmeticOptimizationValue(other.getArithmeticOptimizationValue());
}
if (other.dependencyOptimization_ != 0) {
setDependencyOptimizationValue(other.getDependencyOptimizationValue());
}
if (other.loopOptimization_ != 0) {
setLoopOptimizationValue(other.getLoopOptimizationValue());
}
if (other.functionOptimization_ != 0) {
setFunctionOptimizationValue(other.getFunctionOptimizationValue());
}
if (other.debugStripper_ != 0) {
setDebugStripperValue(other.getDebugStripperValue());
}
if (other.getDisableModelPruning() != false) {
setDisableModelPruning(other.getDisableModelPruning());
}
if (other.scopedAllocatorOptimization_ != 0) {
setScopedAllocatorOptimizationValue(other.getScopedAllocatorOptimizationValue());
}
if (other.pinToHostOptimization_ != 0) {
setPinToHostOptimizationValue(other.getPinToHostOptimizationValue());
}
if (other.getDisableMetaOptimizer() != false) {
setDisableMetaOptimizer(other.getDisableMetaOptimizer());
}
if (other.metaOptimizerIterations_ != 0) {
setMetaOptimizerIterationsValue(other.getMetaOptimizerIterationsValue());
}
if (other.getMinGraphNodes() != 0) {
setMinGraphNodes(other.getMinGraphNodes());
}
if (other.memoryOptimization_ != 0) {
setMemoryOptimizationValue(other.getMemoryOptimizationValue());
}
if (!other.getMemoryOptimizerTargetNodeNameScope().isEmpty()) {
memoryOptimizerTargetNodeNameScope_ = other.memoryOptimizerTargetNodeNameScope_;
onChanged();
}
if (other.hasAutoParallel()) {
mergeAutoParallel(other.getAutoParallel());
}
if (other.hasScopedAllocatorOpts()) {
mergeScopedAllocatorOpts(other.getScopedAllocatorOpts());
}
if (!other.optimizers_.isEmpty()) {
if (optimizers_.isEmpty()) {
optimizers_ = other.optimizers_;
bitField0_ = (bitField0_ & ~0x00080000);
} else {
ensureOptimizersIsMutable();
optimizers_.addAll(other.optimizers_);
}
onChanged();
}
if (customOptimizersBuilder_ == null) {
if (!other.customOptimizers_.isEmpty()) {
if (customOptimizers_.isEmpty()) {
customOptimizers_ = other.customOptimizers_;
bitField0_ = (bitField0_ & ~0x00100000);
} else {
ensureCustomOptimizersIsMutable();
customOptimizers_.addAll(other.customOptimizers_);
}
onChanged();
}
} else {
if (!other.customOptimizers_.isEmpty()) {
if (customOptimizersBuilder_.isEmpty()) {
customOptimizersBuilder_.dispose();
customOptimizersBuilder_ = null;
customOptimizers_ = other.customOptimizers_;
bitField0_ = (bitField0_ & ~0x00100000);
customOptimizersBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getCustomOptimizersFieldBuilder() : null;
} else {
customOptimizersBuilder_.addAllMessages(other.customOptimizers_);
}
}
}
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.RewriterConfig parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.tensorflow.framework.RewriterConfig) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int layoutOptimizer_ = 0;
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public int getLayoutOptimizerValue() {
return layoutOptimizer_;
}
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public Builder setLayoutOptimizerValue(int value) {
layoutOptimizer_ = value;
onChanged();
return this;
}
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getLayoutOptimizer() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(layoutOptimizer_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public Builder setLayoutOptimizer(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
layoutOptimizer_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Optimize tensor layouts (default is ON)
* e.g. This will try to use NCHW layout on GPU which is faster.
*
*
* .tensorflow.RewriterConfig.Toggle layout_optimizer = 1;
*/
public Builder clearLayoutOptimizer() {
layoutOptimizer_ = 0;
onChanged();
return this;
}
private int constantFolding_ = 0;
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public int getConstantFoldingValue() {
return constantFolding_;
}
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public Builder setConstantFoldingValue(int value) {
constantFolding_ = value;
onChanged();
return this;
}
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getConstantFolding() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(constantFolding_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public Builder setConstantFolding(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
constantFolding_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Fold constants (default is ON)
* Statically infer the value of tensors when possible, and materialize the
* result using constants.
*
*
* .tensorflow.RewriterConfig.Toggle constant_folding = 3;
*/
public Builder clearConstantFolding() {
constantFolding_ = 0;
onChanged();
return this;
}
private int shapeOptimization_ = 0;
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public int getShapeOptimizationValue() {
return shapeOptimization_;
}
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public Builder setShapeOptimizationValue(int value) {
shapeOptimization_ = value;
onChanged();
return this;
}
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getShapeOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(shapeOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public Builder setShapeOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
shapeOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Shape optimizations (default is ON)
* Simplify computations made on shapes.
*
*
* .tensorflow.RewriterConfig.Toggle shape_optimization = 13;
*/
public Builder clearShapeOptimization() {
shapeOptimization_ = 0;
onChanged();
return this;
}
private int remapping_ = 0;
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public int getRemappingValue() {
return remapping_;
}
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public Builder setRemappingValue(int value) {
remapping_ = value;
onChanged();
return this;
}
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getRemapping() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(remapping_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public Builder setRemapping(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
remapping_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Remapping (default is ON)
* Remap subgraphs onto more efficient implementations.
*
*
* .tensorflow.RewriterConfig.Toggle remapping = 14;
*/
public Builder clearRemapping() {
remapping_ = 0;
onChanged();
return this;
}
private int arithmeticOptimization_ = 0;
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public int getArithmeticOptimizationValue() {
return arithmeticOptimization_;
}
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public Builder setArithmeticOptimizationValue(int value) {
arithmeticOptimization_ = value;
onChanged();
return this;
}
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getArithmeticOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(arithmeticOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public Builder setArithmeticOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
arithmeticOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Arithmetic optimizations (default is ON)
* e.g. Simplify arithmetic ops; merge ops with same value (like constants).
*
*
* .tensorflow.RewriterConfig.Toggle arithmetic_optimization = 7;
*/
public Builder clearArithmeticOptimization() {
arithmeticOptimization_ = 0;
onChanged();
return this;
}
private int dependencyOptimization_ = 0;
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public int getDependencyOptimizationValue() {
return dependencyOptimization_;
}
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public Builder setDependencyOptimizationValue(int value) {
dependencyOptimization_ = value;
onChanged();
return this;
}
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getDependencyOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(dependencyOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public Builder setDependencyOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
dependencyOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Control dependency optimizations (default is ON).
* Remove redundant control dependencies, which may enable other optimization.
*
*
* .tensorflow.RewriterConfig.Toggle dependency_optimization = 8;
*/
public Builder clearDependencyOptimization() {
dependencyOptimization_ = 0;
onChanged();
return this;
}
private int loopOptimization_ = 0;
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public int getLoopOptimizationValue() {
return loopOptimization_;
}
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public Builder setLoopOptimizationValue(int value) {
loopOptimization_ = value;
onChanged();
return this;
}
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getLoopOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(loopOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public Builder setLoopOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
loopOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Loop optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle loop_optimization = 9;
*/
public Builder clearLoopOptimization() {
loopOptimization_ = 0;
onChanged();
return this;
}
private int functionOptimization_ = 0;
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public int getFunctionOptimizationValue() {
return functionOptimization_;
}
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public Builder setFunctionOptimizationValue(int value) {
functionOptimization_ = value;
onChanged();
return this;
}
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getFunctionOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(functionOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public Builder setFunctionOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
functionOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Function optimizations (default is ON).
*
*
* .tensorflow.RewriterConfig.Toggle function_optimization = 10;
*/
public Builder clearFunctionOptimization() {
functionOptimization_ = 0;
onChanged();
return this;
}
private int debugStripper_ = 0;
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public int getDebugStripperValue() {
return debugStripper_;
}
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public Builder setDebugStripperValue(int value) {
debugStripper_ = value;
onChanged();
return this;
}
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getDebugStripper() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(debugStripper_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public Builder setDebugStripper(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
debugStripper_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Strips debug-related nodes from the graph (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle debug_stripper = 11;
*/
public Builder clearDebugStripper() {
debugStripper_ = 0;
onChanged();
return this;
}
private boolean disableModelPruning_ ;
/**
*
* If true, don't remove unnecessary ops from the graph
*
*
* bool disable_model_pruning = 2;
*/
public boolean getDisableModelPruning() {
return disableModelPruning_;
}
/**
*
* If true, don't remove unnecessary ops from the graph
*
*
* bool disable_model_pruning = 2;
*/
public Builder setDisableModelPruning(boolean value) {
disableModelPruning_ = value;
onChanged();
return this;
}
/**
*
* If true, don't remove unnecessary ops from the graph
*
*
* bool disable_model_pruning = 2;
*/
public Builder clearDisableModelPruning() {
disableModelPruning_ = false;
onChanged();
return this;
}
private int scopedAllocatorOptimization_ = 0;
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public int getScopedAllocatorOptimizationValue() {
return scopedAllocatorOptimization_;
}
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public Builder setScopedAllocatorOptimizationValue(int value) {
scopedAllocatorOptimization_ = value;
onChanged();
return this;
}
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getScopedAllocatorOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(scopedAllocatorOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public Builder setScopedAllocatorOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
scopedAllocatorOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Try to allocate some independent Op outputs contiguously in order to
* merge or eliminate downstream Ops (off by default).
*
*
* .tensorflow.RewriterConfig.Toggle scoped_allocator_optimization = 15;
*/
public Builder clearScopedAllocatorOptimization() {
scopedAllocatorOptimization_ = 0;
onChanged();
return this;
}
private int pinToHostOptimization_ = 0;
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public int getPinToHostOptimizationValue() {
return pinToHostOptimization_;
}
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public Builder setPinToHostOptimizationValue(int value) {
pinToHostOptimization_ = value;
onChanged();
return this;
}
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public org.tensorflow.framework.RewriterConfig.Toggle getPinToHostOptimization() {
org.tensorflow.framework.RewriterConfig.Toggle result = org.tensorflow.framework.RewriterConfig.Toggle.valueOf(pinToHostOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.Toggle.UNRECOGNIZED : result;
}
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public Builder setPinToHostOptimization(org.tensorflow.framework.RewriterConfig.Toggle value) {
if (value == null) {
throw new NullPointerException();
}
pinToHostOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Force small ops onto the CPU (default is OFF).
*
*
* .tensorflow.RewriterConfig.Toggle pin_to_host_optimization = 18;
*/
public Builder clearPinToHostOptimization() {
pinToHostOptimization_ = 0;
onChanged();
return this;
}
private boolean disableMetaOptimizer_ ;
/**
*
* Disable the entire meta optimizer (off by default).
*
*
* bool disable_meta_optimizer = 19;
*/
public boolean getDisableMetaOptimizer() {
return disableMetaOptimizer_;
}
/**
*
* Disable the entire meta optimizer (off by default).
*
*
* bool disable_meta_optimizer = 19;
*/
public Builder setDisableMetaOptimizer(boolean value) {
disableMetaOptimizer_ = value;
onChanged();
return this;
}
/**
*
* Disable the entire meta optimizer (off by default).
*
*
* bool disable_meta_optimizer = 19;
*/
public Builder clearDisableMetaOptimizer() {
disableMetaOptimizer_ = false;
onChanged();
return this;
}
private int metaOptimizerIterations_ = 0;
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public int getMetaOptimizerIterationsValue() {
return metaOptimizerIterations_;
}
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public Builder setMetaOptimizerIterationsValue(int value) {
metaOptimizerIterations_ = value;
onChanged();
return this;
}
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public org.tensorflow.framework.RewriterConfig.NumIterationsType getMetaOptimizerIterations() {
org.tensorflow.framework.RewriterConfig.NumIterationsType result = org.tensorflow.framework.RewriterConfig.NumIterationsType.valueOf(metaOptimizerIterations_);
return result == null ? org.tensorflow.framework.RewriterConfig.NumIterationsType.UNRECOGNIZED : result;
}
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public Builder setMetaOptimizerIterations(org.tensorflow.framework.RewriterConfig.NumIterationsType value) {
if (value == null) {
throw new NullPointerException();
}
metaOptimizerIterations_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Controls how many times we run the optimizers in meta optimizer (default
* is once).
*
*
* .tensorflow.RewriterConfig.NumIterationsType meta_optimizer_iterations = 12;
*/
public Builder clearMetaOptimizerIterations() {
metaOptimizerIterations_ = 0;
onChanged();
return this;
}
private int minGraphNodes_ ;
/**
*
* The minimum number of nodes in a graph to optimizer. For smaller graphs,
* optimization is skipped.
* 0 means the system picks an appropriate number.
* < 0 means do not skip optimization.
*
*
* int32 min_graph_nodes = 17;
*/
public int getMinGraphNodes() {
return minGraphNodes_;
}
/**
*
* The minimum number of nodes in a graph to optimizer. For smaller graphs,
* optimization is skipped.
* 0 means the system picks an appropriate number.
* < 0 means do not skip optimization.
*
*
* int32 min_graph_nodes = 17;
*/
public Builder setMinGraphNodes(int value) {
minGraphNodes_ = value;
onChanged();
return this;
}
/**
*
* The minimum number of nodes in a graph to optimizer. For smaller graphs,
* optimization is skipped.
* 0 means the system picks an appropriate number.
* < 0 means do not skip optimization.
*
*
* int32 min_graph_nodes = 17;
*/
public Builder clearMinGraphNodes() {
minGraphNodes_ = 0;
onChanged();
return this;
}
private int memoryOptimization_ = 0;
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public int getMemoryOptimizationValue() {
return memoryOptimization_;
}
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public Builder setMemoryOptimizationValue(int value) {
memoryOptimization_ = value;
onChanged();
return this;
}
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public org.tensorflow.framework.RewriterConfig.MemOptType getMemoryOptimization() {
org.tensorflow.framework.RewriterConfig.MemOptType result = org.tensorflow.framework.RewriterConfig.MemOptType.valueOf(memoryOptimization_);
return result == null ? org.tensorflow.framework.RewriterConfig.MemOptType.UNRECOGNIZED : result;
}
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public Builder setMemoryOptimization(org.tensorflow.framework.RewriterConfig.MemOptType value) {
if (value == null) {
throw new NullPointerException();
}
memoryOptimization_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Configures memory optimization passes through the meta-optimizer. Has no
* effect on manually requested memory optimization passes in the optimizers
* field.
*
*
* .tensorflow.RewriterConfig.MemOptType memory_optimization = 4;
*/
public Builder clearMemoryOptimization() {
memoryOptimization_ = 0;
onChanged();
return this;
}
private java.lang.Object memoryOptimizerTargetNodeNameScope_ = "";
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public java.lang.String getMemoryOptimizerTargetNodeNameScope() {
java.lang.Object ref = memoryOptimizerTargetNodeNameScope_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
memoryOptimizerTargetNodeNameScope_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public com.google.protobuf.ByteString
getMemoryOptimizerTargetNodeNameScopeBytes() {
java.lang.Object ref = memoryOptimizerTargetNodeNameScope_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
memoryOptimizerTargetNodeNameScope_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public Builder setMemoryOptimizerTargetNodeNameScope(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
memoryOptimizerTargetNodeNameScope_ = value;
onChanged();
return this;
}
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public Builder clearMemoryOptimizerTargetNodeNameScope() {
memoryOptimizerTargetNodeNameScope_ = getDefaultInstance().getMemoryOptimizerTargetNodeNameScope();
onChanged();
return this;
}
/**
*
* A node name scope for node names which are valid outputs of recompuations.
* Inputs to nodes that match this scope may be recomputed (subject either to
* manual annotation of those input nodes or to manual annotation and
* heuristics depending on memory_optimization), but the nodes themselves will
* not be recomputed. This matches any sub-scopes as well, meaning the scope
* can appear not just as a top-level scope. For example, if the value is
* "gradients/", the default, it will match node name "gradients/foo",
* "foo/gradients/bar", but not "foo_gradients/"
*
*
* string memory_optimizer_target_node_name_scope = 6;
*/
public Builder setMemoryOptimizerTargetNodeNameScopeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
memoryOptimizerTargetNodeNameScope_ = value;
onChanged();
return this;
}
private org.tensorflow.framework.AutoParallelOptions autoParallel_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.AutoParallelOptions, org.tensorflow.framework.AutoParallelOptions.Builder, org.tensorflow.framework.AutoParallelOptionsOrBuilder> autoParallelBuilder_;
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public boolean hasAutoParallel() {
return autoParallelBuilder_ != null || autoParallel_ != null;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public org.tensorflow.framework.AutoParallelOptions getAutoParallel() {
if (autoParallelBuilder_ == null) {
return autoParallel_ == null ? org.tensorflow.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_;
} else {
return autoParallelBuilder_.getMessage();
}
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public Builder setAutoParallel(org.tensorflow.framework.AutoParallelOptions value) {
if (autoParallelBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
autoParallel_ = value;
onChanged();
} else {
autoParallelBuilder_.setMessage(value);
}
return this;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public Builder setAutoParallel(
org.tensorflow.framework.AutoParallelOptions.Builder builderForValue) {
if (autoParallelBuilder_ == null) {
autoParallel_ = builderForValue.build();
onChanged();
} else {
autoParallelBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public Builder mergeAutoParallel(org.tensorflow.framework.AutoParallelOptions value) {
if (autoParallelBuilder_ == null) {
if (autoParallel_ != null) {
autoParallel_ =
org.tensorflow.framework.AutoParallelOptions.newBuilder(autoParallel_).mergeFrom(value).buildPartial();
} else {
autoParallel_ = value;
}
onChanged();
} else {
autoParallelBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public Builder clearAutoParallel() {
if (autoParallelBuilder_ == null) {
autoParallel_ = null;
onChanged();
} else {
autoParallel_ = null;
autoParallelBuilder_ = null;
}
return this;
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public org.tensorflow.framework.AutoParallelOptions.Builder getAutoParallelBuilder() {
onChanged();
return getAutoParallelFieldBuilder().getBuilder();
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
public org.tensorflow.framework.AutoParallelOptionsOrBuilder getAutoParallelOrBuilder() {
if (autoParallelBuilder_ != null) {
return autoParallelBuilder_.getMessageOrBuilder();
} else {
return autoParallel_ == null ?
org.tensorflow.framework.AutoParallelOptions.getDefaultInstance() : autoParallel_;
}
}
/**
*
* Configures AutoParallel optimization passes either through the
* meta-optimizer or when manually specified through the optimizers field.
*
*
* .tensorflow.AutoParallelOptions auto_parallel = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.AutoParallelOptions, org.tensorflow.framework.AutoParallelOptions.Builder, org.tensorflow.framework.AutoParallelOptionsOrBuilder>
getAutoParallelFieldBuilder() {
if (autoParallelBuilder_ == null) {
autoParallelBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.AutoParallelOptions, org.tensorflow.framework.AutoParallelOptions.Builder, org.tensorflow.framework.AutoParallelOptionsOrBuilder>(
getAutoParallel(),
getParentForChildren(),
isClean());
autoParallel_ = null;
}
return autoParallelBuilder_;
}
private org.tensorflow.framework.ScopedAllocatorOptions scopedAllocatorOpts_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.ScopedAllocatorOptions, org.tensorflow.framework.ScopedAllocatorOptions.Builder, org.tensorflow.framework.ScopedAllocatorOptionsOrBuilder> scopedAllocatorOptsBuilder_;
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public boolean hasScopedAllocatorOpts() {
return scopedAllocatorOptsBuilder_ != null || scopedAllocatorOpts_ != null;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public org.tensorflow.framework.ScopedAllocatorOptions getScopedAllocatorOpts() {
if (scopedAllocatorOptsBuilder_ == null) {
return scopedAllocatorOpts_ == null ? org.tensorflow.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_;
} else {
return scopedAllocatorOptsBuilder_.getMessage();
}
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public Builder setScopedAllocatorOpts(org.tensorflow.framework.ScopedAllocatorOptions value) {
if (scopedAllocatorOptsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
scopedAllocatorOpts_ = value;
onChanged();
} else {
scopedAllocatorOptsBuilder_.setMessage(value);
}
return this;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public Builder setScopedAllocatorOpts(
org.tensorflow.framework.ScopedAllocatorOptions.Builder builderForValue) {
if (scopedAllocatorOptsBuilder_ == null) {
scopedAllocatorOpts_ = builderForValue.build();
onChanged();
} else {
scopedAllocatorOptsBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public Builder mergeScopedAllocatorOpts(org.tensorflow.framework.ScopedAllocatorOptions value) {
if (scopedAllocatorOptsBuilder_ == null) {
if (scopedAllocatorOpts_ != null) {
scopedAllocatorOpts_ =
org.tensorflow.framework.ScopedAllocatorOptions.newBuilder(scopedAllocatorOpts_).mergeFrom(value).buildPartial();
} else {
scopedAllocatorOpts_ = value;
}
onChanged();
} else {
scopedAllocatorOptsBuilder_.mergeFrom(value);
}
return this;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public Builder clearScopedAllocatorOpts() {
if (scopedAllocatorOptsBuilder_ == null) {
scopedAllocatorOpts_ = null;
onChanged();
} else {
scopedAllocatorOpts_ = null;
scopedAllocatorOptsBuilder_ = null;
}
return this;
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public org.tensorflow.framework.ScopedAllocatorOptions.Builder getScopedAllocatorOptsBuilder() {
onChanged();
return getScopedAllocatorOptsFieldBuilder().getBuilder();
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
public org.tensorflow.framework.ScopedAllocatorOptionsOrBuilder getScopedAllocatorOptsOrBuilder() {
if (scopedAllocatorOptsBuilder_ != null) {
return scopedAllocatorOptsBuilder_.getMessageOrBuilder();
} else {
return scopedAllocatorOpts_ == null ?
org.tensorflow.framework.ScopedAllocatorOptions.getDefaultInstance() : scopedAllocatorOpts_;
}
}
/**
* .tensorflow.ScopedAllocatorOptions scoped_allocator_opts = 16;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.ScopedAllocatorOptions, org.tensorflow.framework.ScopedAllocatorOptions.Builder, org.tensorflow.framework.ScopedAllocatorOptionsOrBuilder>
getScopedAllocatorOptsFieldBuilder() {
if (scopedAllocatorOptsBuilder_ == null) {
scopedAllocatorOptsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.tensorflow.framework.ScopedAllocatorOptions, org.tensorflow.framework.ScopedAllocatorOptions.Builder, org.tensorflow.framework.ScopedAllocatorOptionsOrBuilder>(
getScopedAllocatorOpts(),
getParentForChildren(),
isClean());
scopedAllocatorOpts_ = null;
}
return scopedAllocatorOptsBuilder_;
}
private com.google.protobuf.LazyStringList optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureOptimizersIsMutable() {
if (!((bitField0_ & 0x00080000) == 0x00080000)) {
optimizers_ = new com.google.protobuf.LazyStringArrayList(optimizers_);
bitField0_ |= 0x00080000;
}
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public com.google.protobuf.ProtocolStringList
getOptimizersList() {
return optimizers_.getUnmodifiableView();
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public int getOptimizersCount() {
return optimizers_.size();
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public java.lang.String getOptimizers(int index) {
return optimizers_.get(index);
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public com.google.protobuf.ByteString
getOptimizersBytes(int index) {
return optimizers_.getByteString(index);
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public Builder setOptimizers(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptimizersIsMutable();
optimizers_.set(index, value);
onChanged();
return this;
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public Builder addOptimizers(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOptimizersIsMutable();
optimizers_.add(value);
onChanged();
return this;
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public Builder addAllOptimizers(
java.lang.Iterable values) {
ensureOptimizersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, optimizers_);
onChanged();
return this;
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public Builder clearOptimizers() {
optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00080000);
onChanged();
return this;
}
/**
*
* If non-empty, will use this as an alternative way to specify a list of
* optimizations to turn on and the order of the optimizations (replacing the
* meta-optimizer).
* Of the RewriterConfig options, only the AutoParallel configuration options
* (the auto_parallel field) apply to manually requested optimization passes
* ("autoparallel"). Memory optimization passes ("memory") invoked here are
* not configurable (in contrast to memory optimization passes through the
* meta-optimizer) and act only on manual op annotations.
* Custom optimizers (see custom_optimizers) that are not part of this
* schedule will be run after - in the order that they were specified.
*
*
* repeated string optimizers = 100;
*/
public Builder addOptimizersBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureOptimizersIsMutable();
optimizers_.add(value);
onChanged();
return this;
}
private java.util.List customOptimizers_ =
java.util.Collections.emptyList();
private void ensureCustomOptimizersIsMutable() {
if (!((bitField0_ & 0x00100000) == 0x00100000)) {
customOptimizers_ = new java.util.ArrayList(customOptimizers_);
bitField0_ |= 0x00100000;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder> customOptimizersBuilder_;
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public java.util.List getCustomOptimizersList() {
if (customOptimizersBuilder_ == null) {
return java.util.Collections.unmodifiableList(customOptimizers_);
} else {
return customOptimizersBuilder_.getMessageList();
}
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public int getCustomOptimizersCount() {
if (customOptimizersBuilder_ == null) {
return customOptimizers_.size();
} else {
return customOptimizersBuilder_.getCount();
}
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer getCustomOptimizers(int index) {
if (customOptimizersBuilder_ == null) {
return customOptimizers_.get(index);
} else {
return customOptimizersBuilder_.getMessage(index);
}
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder setCustomOptimizers(
int index, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer value) {
if (customOptimizersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomOptimizersIsMutable();
customOptimizers_.set(index, value);
onChanged();
} else {
customOptimizersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder setCustomOptimizers(
int index, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) {
if (customOptimizersBuilder_ == null) {
ensureCustomOptimizersIsMutable();
customOptimizers_.set(index, builderForValue.build());
onChanged();
} else {
customOptimizersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder addCustomOptimizers(org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer value) {
if (customOptimizersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomOptimizersIsMutable();
customOptimizers_.add(value);
onChanged();
} else {
customOptimizersBuilder_.addMessage(value);
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder addCustomOptimizers(
int index, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer value) {
if (customOptimizersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCustomOptimizersIsMutable();
customOptimizers_.add(index, value);
onChanged();
} else {
customOptimizersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder addCustomOptimizers(
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) {
if (customOptimizersBuilder_ == null) {
ensureCustomOptimizersIsMutable();
customOptimizers_.add(builderForValue.build());
onChanged();
} else {
customOptimizersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder addCustomOptimizers(
int index, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder builderForValue) {
if (customOptimizersBuilder_ == null) {
ensureCustomOptimizersIsMutable();
customOptimizers_.add(index, builderForValue.build());
onChanged();
} else {
customOptimizersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder addAllCustomOptimizers(
java.lang.Iterable extends org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer> values) {
if (customOptimizersBuilder_ == null) {
ensureCustomOptimizersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, customOptimizers_);
onChanged();
} else {
customOptimizersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder clearCustomOptimizers() {
if (customOptimizersBuilder_ == null) {
customOptimizers_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00100000);
onChanged();
} else {
customOptimizersBuilder_.clear();
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public Builder removeCustomOptimizers(int index) {
if (customOptimizersBuilder_ == null) {
ensureCustomOptimizersIsMutable();
customOptimizers_.remove(index);
onChanged();
} else {
customOptimizersBuilder_.remove(index);
}
return this;
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder getCustomOptimizersBuilder(
int index) {
return getCustomOptimizersFieldBuilder().getBuilder(index);
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder getCustomOptimizersOrBuilder(
int index) {
if (customOptimizersBuilder_ == null) {
return customOptimizers_.get(index); } else {
return customOptimizersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public java.util.List extends org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder>
getCustomOptimizersOrBuilderList() {
if (customOptimizersBuilder_ != null) {
return customOptimizersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(customOptimizers_);
}
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder() {
return getCustomOptimizersFieldBuilder().addBuilder(
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance());
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder addCustomOptimizersBuilder(
int index) {
return getCustomOptimizersFieldBuilder().addBuilder(
index, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.getDefaultInstance());
}
/**
*
* list of CustomGraphOptimizers to apply.
*
*
* repeated .tensorflow.RewriterConfig.CustomGraphOptimizer custom_optimizers = 200;
*/
public java.util.List
getCustomOptimizersBuilderList() {
return getCustomOptimizersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder>
getCustomOptimizersFieldBuilder() {
if (customOptimizersBuilder_ == null) {
customOptimizersBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizer.Builder, org.tensorflow.framework.RewriterConfig.CustomGraphOptimizerOrBuilder>(
customOptimizers_,
((bitField0_ & 0x00100000) == 0x00100000),
getParentForChildren(),
isClean());
customOptimizers_ = null;
}
return customOptimizersBuilder_;
}
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.RewriterConfig)
}
// @@protoc_insertion_point(class_scope:tensorflow.RewriterConfig)
private static final org.tensorflow.framework.RewriterConfig DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.tensorflow.framework.RewriterConfig();
}
public static org.tensorflow.framework.RewriterConfig getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public RewriterConfig parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RewriterConfig(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.RewriterConfig getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy