All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tensorflow.framework.RewriterConfig Maven / Gradle / Ivy

// 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 { // Use RewriterConfig.newBuilder() to construct. private RewriterConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private RewriterConfig() { optimizeTensorLayout_ = false; disableModelPruning_ = false; constantFolding_ = false; memoryOptimization_ = 0; optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } private RewriterConfig( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); int mutable_bitField0_ = 0; try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!input.skipField(tag)) { done = true; } break; } case 8: { optimizeTensorLayout_ = input.readBool(); break; } case 16: { disableModelPruning_ = input.readBool(); break; } case 24: { constantFolding_ = input.readBool(); 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 802: { java.lang.String s = input.readStringRequireUtf8(); if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { optimizers_ = new com.google.protobuf.LazyStringArrayList(); mutable_bitField0_ |= 0x00000020; } optimizers_.add(s); 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_ & 0x00000020) == 0x00000020)) { optimizers_ = optimizers_.getUnmodifiableView(); } 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.MemOptType} */ public enum MemOptType implements com.google.protobuf.ProtocolMessageEnum { /** *
     * Disabled in the meta-optimizer.
     * 
* * NO_MEM_OPT = 0; */ NO_MEM_OPT(0), /** *
     * Driven by manual op-level annotations.
     * 
* * MANUAL = 1; */ MANUAL(1), /** *
     * Driven by heuristics. The behavior of these heuristics is subject to
     * change. Currently includes an experimental recomputation heuristic.
     * 
* * HEURISTICS = 2; */ HEURISTICS(2), UNRECOGNIZED(-1), ; /** *
     * Disabled in the meta-optimizer.
     * 
* * NO_MEM_OPT = 0; */ public static final int NO_MEM_OPT_VALUE = 0; /** *
     * Driven by manual op-level annotations.
     * 
* * MANUAL = 1; */ public static final int MANUAL_VALUE = 1; /** *
     * Driven by heuristics. The behavior of these heuristics is subject to
     * change. Currently includes an experimental recomputation heuristic.
     * 
* * HEURISTICS = 2; */ public static final int HEURISTICS_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 MemOptType valueOf(int value) { return forNumber(value); } public static MemOptType forNumber(int value) { switch (value) { case 0: return NO_MEM_OPT; case 1: return MANUAL; case 2: 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(0); } 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) } private int bitField0_; public static final int OPTIMIZE_TENSOR_LAYOUT_FIELD_NUMBER = 1; private boolean optimizeTensorLayout_; /** * bool optimize_tensor_layout = 1; */ public boolean getOptimizeTensorLayout() { return optimizeTensorLayout_; } public static final int DISABLE_MODEL_PRUNING_FIELD_NUMBER = 2; private boolean disableModelPruning_; /** * bool disable_model_pruning = 2; */ public boolean getDisableModelPruning() { return disableModelPruning_; } public static final int CONSTANT_FOLDING_FIELD_NUMBER = 3; private boolean constantFolding_; /** * bool constant_folding = 3; */ public boolean getConstantFolding() { return constantFolding_; } 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 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 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.
   * 
* * 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.
   * 
* * 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.
   * 
* * 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.
   * 
* * repeated string optimizers = 100; */ public com.google.protobuf.ByteString getOptimizersBytes(int index) { return optimizers_.getByteString(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 (optimizeTensorLayout_ != false) { output.writeBool(1, optimizeTensorLayout_); } if (disableModelPruning_ != false) { output.writeBool(2, disableModelPruning_); } if (constantFolding_ != false) { output.writeBool(3, constantFolding_); } if (memoryOptimization_ != org.tensorflow.framework.RewriterConfig.MemOptType.NO_MEM_OPT.getNumber()) { output.writeEnum(4, memoryOptimization_); } if (autoParallel_ != null) { output.writeMessage(5, getAutoParallel()); } for (int i = 0; i < optimizers_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 100, optimizers_.getRaw(i)); } } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (optimizeTensorLayout_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(1, optimizeTensorLayout_); } if (disableModelPruning_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(2, disableModelPruning_); } if (constantFolding_ != false) { size += com.google.protobuf.CodedOutputStream .computeBoolSize(3, constantFolding_); } if (memoryOptimization_ != org.tensorflow.framework.RewriterConfig.MemOptType.NO_MEM_OPT.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, memoryOptimization_); } if (autoParallel_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getAutoParallel()); } { int dataSize = 0; for (int i = 0; i < optimizers_.size(); i++) { dataSize += computeStringSizeNoTag(optimizers_.getRaw(i)); } size += dataSize; size += 2 * getOptimizersList().size(); } memoizedSize = size; return size; } private static final long serialVersionUID = 0L; @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 && (getOptimizeTensorLayout() == other.getOptimizeTensorLayout()); result = result && (getDisableModelPruning() == other.getDisableModelPruning()); result = result && (getConstantFolding() == other.getConstantFolding()); result = result && memoryOptimization_ == other.memoryOptimization_; result = result && (hasAutoParallel() == other.hasAutoParallel()); if (hasAutoParallel()) { result = result && getAutoParallel() .equals(other.getAutoParallel()); } result = result && getOptimizersList() .equals(other.getOptimizersList()); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + OPTIMIZE_TENSOR_LAYOUT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getOptimizeTensorLayout()); hash = (37 * hash) + DISABLE_MODEL_PRUNING_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getDisableModelPruning()); hash = (37 * hash) + CONSTANT_FOLDING_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getConstantFolding()); hash = (37 * hash) + MEMORY_OPTIMIZATION_FIELD_NUMBER; hash = (53 * hash) + memoryOptimization_; if (hasAutoParallel()) { hash = (37 * hash) + AUTO_PARALLEL_FIELD_NUMBER; hash = (53 * hash) + getAutoParallel().hashCode(); } if (getOptimizersCount() > 0) { hash = (37 * hash) + OPTIMIZERS_FIELD_NUMBER; hash = (53 * hash) + getOptimizersList().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) { } } public Builder clear() { super.clear(); optimizeTensorLayout_ = false; disableModelPruning_ = false; constantFolding_ = false; memoryOptimization_ = 0; if (autoParallelBuilder_ == null) { autoParallel_ = null; } else { autoParallel_ = null; autoParallelBuilder_ = null; } optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000020); 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.optimizeTensorLayout_ = optimizeTensorLayout_; result.disableModelPruning_ = disableModelPruning_; result.constantFolding_ = constantFolding_; result.memoryOptimization_ = memoryOptimization_; if (autoParallelBuilder_ == null) { result.autoParallel_ = autoParallel_; } else { result.autoParallel_ = autoParallelBuilder_.build(); } if (((bitField0_ & 0x00000020) == 0x00000020)) { optimizers_ = optimizers_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000020); } result.optimizers_ = optimizers_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, 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, Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, 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.getOptimizeTensorLayout() != false) { setOptimizeTensorLayout(other.getOptimizeTensorLayout()); } if (other.getDisableModelPruning() != false) { setDisableModelPruning(other.getDisableModelPruning()); } if (other.getConstantFolding() != false) { setConstantFolding(other.getConstantFolding()); } if (other.memoryOptimization_ != 0) { setMemoryOptimizationValue(other.getMemoryOptimizationValue()); } if (other.hasAutoParallel()) { mergeAutoParallel(other.getAutoParallel()); } if (!other.optimizers_.isEmpty()) { if (optimizers_.isEmpty()) { optimizers_ = other.optimizers_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureOptimizersIsMutable(); optimizers_.addAll(other.optimizers_); } onChanged(); } 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 boolean optimizeTensorLayout_ ; /** * bool optimize_tensor_layout = 1; */ public boolean getOptimizeTensorLayout() { return optimizeTensorLayout_; } /** * bool optimize_tensor_layout = 1; */ public Builder setOptimizeTensorLayout(boolean value) { optimizeTensorLayout_ = value; onChanged(); return this; } /** * bool optimize_tensor_layout = 1; */ public Builder clearOptimizeTensorLayout() { optimizeTensorLayout_ = false; onChanged(); return this; } private boolean disableModelPruning_ ; /** * bool disable_model_pruning = 2; */ public boolean getDisableModelPruning() { return disableModelPruning_; } /** * bool disable_model_pruning = 2; */ public Builder setDisableModelPruning(boolean value) { disableModelPruning_ = value; onChanged(); return this; } /** * bool disable_model_pruning = 2; */ public Builder clearDisableModelPruning() { disableModelPruning_ = false; onChanged(); return this; } private boolean constantFolding_ ; /** * bool constant_folding = 3; */ public boolean getConstantFolding() { return constantFolding_; } /** * bool constant_folding = 3; */ public Builder setConstantFolding(boolean value) { constantFolding_ = value; onChanged(); return this; } /** * bool constant_folding = 3; */ public Builder clearConstantFolding() { constantFolding_ = false; 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 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 com.google.protobuf.LazyStringList optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureOptimizersIsMutable() { if (!((bitField0_ & 0x00000020) == 0x00000020)) { optimizers_ = new com.google.protobuf.LazyStringArrayList(optimizers_); bitField0_ |= 0x00000020; } } /** *
     * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * 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.
     * 
* * repeated string optimizers = 100; */ public Builder clearOptimizers() { optimizers_ = com.google.protobuf.LazyStringArrayList.EMPTY; bitField0_ = (bitField0_ & ~0x00000020); 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.
     * 
* * 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; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return this; } // @@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