Class OptimizerOptions.Builder

  • All Implemented Interfaces:
    Cloneable, org.nd4j.shade.protobuf.Message.Builder, org.nd4j.shade.protobuf.MessageLite.Builder, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder, OptimizerOptionsOrBuilder
    Enclosing class:
    OptimizerOptions

    public static final class OptimizerOptions.Builder
    extends org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
    implements OptimizerOptionsOrBuilder
     Options passed to the graph optimizer
     
    Protobuf type tensorflow.OptimizerOptions
    • Method Detail

      • getDescriptor

        public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • clear

        public OptimizerOptions.Builder clear()
        Specified by:
        clear in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clear in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clear in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • getDescriptorForType

        public org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • getDefaultInstanceForType

        public OptimizerOptions getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
      • build

        public OptimizerOptions build()
        Specified by:
        build in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        build in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • buildPartial

        public OptimizerOptions buildPartial()
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • clone

        public OptimizerOptions.Builder clone()
        Specified by:
        clone in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clone in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clone in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • setField

        public OptimizerOptions.Builder setField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        setField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • clearField

        public OptimizerOptions.Builder clearField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • clearOneof

        public OptimizerOptions.Builder clearOneof​(org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearOneof in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • setRepeatedField

        public OptimizerOptions.Builder setRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                         int index,
                                                         Object value)
        Specified by:
        setRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • addRepeatedField

        public OptimizerOptions.Builder addRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                         Object value)
        Specified by:
        addRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • mergeFrom

        public OptimizerOptions.Builder mergeFrom​(org.nd4j.shade.protobuf.Message other)
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<OptimizerOptions.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • mergeFrom

        public OptimizerOptions.Builder mergeFrom​(org.nd4j.shade.protobuf.CodedInputStream input,
                                                  org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<OptimizerOptions.Builder>
        Throws:
        IOException
      • getDoCommonSubexpressionElimination

        public boolean getDoCommonSubexpressionElimination()
         If true, optimize the graph using common subexpression elimination.
         
        bool do_common_subexpression_elimination = 1;
        Specified by:
        getDoCommonSubexpressionElimination in interface OptimizerOptionsOrBuilder
        Returns:
        The doCommonSubexpressionElimination.
      • setDoCommonSubexpressionElimination

        public OptimizerOptions.Builder setDoCommonSubexpressionElimination​(boolean value)
         If true, optimize the graph using common subexpression elimination.
         
        bool do_common_subexpression_elimination = 1;
        Parameters:
        value - The doCommonSubexpressionElimination to set.
        Returns:
        This builder for chaining.
      • clearDoCommonSubexpressionElimination

        public OptimizerOptions.Builder clearDoCommonSubexpressionElimination()
         If true, optimize the graph using common subexpression elimination.
         
        bool do_common_subexpression_elimination = 1;
        Returns:
        This builder for chaining.
      • getDoConstantFolding

        public boolean getDoConstantFolding()
         If true, perform constant folding optimization on the graph.
         
        bool do_constant_folding = 2;
        Specified by:
        getDoConstantFolding in interface OptimizerOptionsOrBuilder
        Returns:
        The doConstantFolding.
      • setDoConstantFolding

        public OptimizerOptions.Builder setDoConstantFolding​(boolean value)
         If true, perform constant folding optimization on the graph.
         
        bool do_constant_folding = 2;
        Parameters:
        value - The doConstantFolding to set.
        Returns:
        This builder for chaining.
      • clearDoConstantFolding

        public OptimizerOptions.Builder clearDoConstantFolding()
         If true, perform constant folding optimization on the graph.
         
        bool do_constant_folding = 2;
        Returns:
        This builder for chaining.
      • getMaxFoldedConstantInBytes

        public long getMaxFoldedConstantInBytes()
         Constant folding optimization replaces tensors whose values can be
         predetermined, with constant nodes. To avoid inserting too large constants,
         the size of each constant created can be limited. If this value is zero, a
         default limit of 10 MiB will be applied. If constant folding optimization
         is disabled, this value is ignored.
         
        int64 max_folded_constant_in_bytes = 6;
        Specified by:
        getMaxFoldedConstantInBytes in interface OptimizerOptionsOrBuilder
        Returns:
        The maxFoldedConstantInBytes.
      • setMaxFoldedConstantInBytes

        public OptimizerOptions.Builder setMaxFoldedConstantInBytes​(long value)
         Constant folding optimization replaces tensors whose values can be
         predetermined, with constant nodes. To avoid inserting too large constants,
         the size of each constant created can be limited. If this value is zero, a
         default limit of 10 MiB will be applied. If constant folding optimization
         is disabled, this value is ignored.
         
        int64 max_folded_constant_in_bytes = 6;
        Parameters:
        value - The maxFoldedConstantInBytes to set.
        Returns:
        This builder for chaining.
      • clearMaxFoldedConstantInBytes

        public OptimizerOptions.Builder clearMaxFoldedConstantInBytes()
         Constant folding optimization replaces tensors whose values can be
         predetermined, with constant nodes. To avoid inserting too large constants,
         the size of each constant created can be limited. If this value is zero, a
         default limit of 10 MiB will be applied. If constant folding optimization
         is disabled, this value is ignored.
         
        int64 max_folded_constant_in_bytes = 6;
        Returns:
        This builder for chaining.
      • getDoFunctionInlining

        public boolean getDoFunctionInlining()
         If true, perform function inlining on the graph.
         
        bool do_function_inlining = 4;
        Specified by:
        getDoFunctionInlining in interface OptimizerOptionsOrBuilder
        Returns:
        The doFunctionInlining.
      • setDoFunctionInlining

        public OptimizerOptions.Builder setDoFunctionInlining​(boolean value)
         If true, perform function inlining on the graph.
         
        bool do_function_inlining = 4;
        Parameters:
        value - The doFunctionInlining to set.
        Returns:
        This builder for chaining.
      • clearDoFunctionInlining

        public OptimizerOptions.Builder clearDoFunctionInlining()
         If true, perform function inlining on the graph.
         
        bool do_function_inlining = 4;
        Returns:
        This builder for chaining.
      • getOptLevelValue

        public int getOptLevelValue()
         Overall optimization level. The actual optimizations applied will be the
         logical OR of the flags that this level implies and any flags already set.
         
        .tensorflow.OptimizerOptions.Level opt_level = 3;
        Specified by:
        getOptLevelValue in interface OptimizerOptionsOrBuilder
        Returns:
        The enum numeric value on the wire for optLevel.
      • setOptLevelValue

        public OptimizerOptions.Builder setOptLevelValue​(int value)
         Overall optimization level. The actual optimizations applied will be the
         logical OR of the flags that this level implies and any flags already set.
         
        .tensorflow.OptimizerOptions.Level opt_level = 3;
        Parameters:
        value - The enum numeric value on the wire for optLevel to set.
        Returns:
        This builder for chaining.
      • getOptLevel

        public OptimizerOptions.Level getOptLevel()
         Overall optimization level. The actual optimizations applied will be the
         logical OR of the flags that this level implies and any flags already set.
         
        .tensorflow.OptimizerOptions.Level opt_level = 3;
        Specified by:
        getOptLevel in interface OptimizerOptionsOrBuilder
        Returns:
        The optLevel.
      • setOptLevel

        public OptimizerOptions.Builder setOptLevel​(OptimizerOptions.Level value)
         Overall optimization level. The actual optimizations applied will be the
         logical OR of the flags that this level implies and any flags already set.
         
        .tensorflow.OptimizerOptions.Level opt_level = 3;
        Parameters:
        value - The optLevel to set.
        Returns:
        This builder for chaining.
      • clearOptLevel

        public OptimizerOptions.Builder clearOptLevel()
         Overall optimization level. The actual optimizations applied will be the
         logical OR of the flags that this level implies and any flags already set.
         
        .tensorflow.OptimizerOptions.Level opt_level = 3;
        Returns:
        This builder for chaining.
      • getGlobalJitLevelValue

        public int getGlobalJitLevelValue()
        .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
        Specified by:
        getGlobalJitLevelValue in interface OptimizerOptionsOrBuilder
        Returns:
        The enum numeric value on the wire for globalJitLevel.
      • setGlobalJitLevelValue

        public OptimizerOptions.Builder setGlobalJitLevelValue​(int value)
        .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
        Parameters:
        value - The enum numeric value on the wire for globalJitLevel to set.
        Returns:
        This builder for chaining.
      • clearGlobalJitLevel

        public OptimizerOptions.Builder clearGlobalJitLevel()
        .tensorflow.OptimizerOptions.GlobalJitLevel global_jit_level = 5;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final OptimizerOptions.Builder setUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>
      • mergeUnknownFields

        public final OptimizerOptions.Builder mergeUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<OptimizerOptions.Builder>