Class GraphDef.Builder

All Implemented Interfaces:
Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, Cloneable, GraphDefOrBuilder
Enclosing class:
GraphDef

public static final class GraphDef.Builder extends GeneratedMessageV3.Builder<GraphDef.Builder> implements GraphDefOrBuilder
Represents the graph of operations
Protobuf type tensorflow.GraphDef
  • Method Details

    • getDescriptor

      public static final Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • clear

      public GraphDef.Builder clear()
      Specified by:
      clear in interface Message.Builder
      Specified by:
      clear in interface MessageLite.Builder
      Overrides:
      clear in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • getDescriptorForType

      public Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface Message.Builder
      Specified by:
      getDescriptorForType in interface MessageOrBuilder
      Overrides:
      getDescriptorForType in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • getDefaultInstanceForType

      public GraphDef getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface MessageOrBuilder
    • build

      public GraphDef build()
      Specified by:
      build in interface Message.Builder
      Specified by:
      build in interface MessageLite.Builder
    • buildPartial

      public GraphDef buildPartial()
      Specified by:
      buildPartial in interface Message.Builder
      Specified by:
      buildPartial in interface MessageLite.Builder
    • clone

      public GraphDef.Builder clone()
      Specified by:
      clone in interface Message.Builder
      Specified by:
      clone in interface MessageLite.Builder
      Overrides:
      clone in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • setField

      public GraphDef.Builder setField(Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface Message.Builder
      Overrides:
      setField in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • clearField

      public GraphDef.Builder clearField(Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface Message.Builder
      Overrides:
      clearField in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • clearOneof

      public GraphDef.Builder clearOneof(Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface Message.Builder
      Overrides:
      clearOneof in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • setRepeatedField

      public GraphDef.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface Message.Builder
      Overrides:
      setRepeatedField in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • addRepeatedField

      public GraphDef.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface Message.Builder
      Overrides:
      addRepeatedField in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • mergeFrom

      public GraphDef.Builder mergeFrom(Message other)
      Specified by:
      mergeFrom in interface Message.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<GraphDef.Builder>
    • mergeFrom

      public GraphDef.Builder mergeFrom(GraphDef other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface MessageLiteOrBuilder
      Overrides:
      isInitialized in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • mergeFrom

      public GraphDef.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface Message.Builder
      Specified by:
      mergeFrom in interface MessageLite.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<GraphDef.Builder>
      Throws:
      IOException
    • getNodeList

      public List<NodeDef> getNodeList()
      repeated .tensorflow.NodeDef node = 1;
      Specified by:
      getNodeList in interface GraphDefOrBuilder
    • getNodeCount

      public int getNodeCount()
      repeated .tensorflow.NodeDef node = 1;
      Specified by:
      getNodeCount in interface GraphDefOrBuilder
    • getNode

      public NodeDef getNode(int index)
      repeated .tensorflow.NodeDef node = 1;
      Specified by:
      getNode in interface GraphDefOrBuilder
    • setNode

      public GraphDef.Builder setNode(int index, NodeDef value)
      repeated .tensorflow.NodeDef node = 1;
    • setNode

      public GraphDef.Builder setNode(int index, NodeDef.Builder builderForValue)
      repeated .tensorflow.NodeDef node = 1;
    • addNode

      public GraphDef.Builder addNode(NodeDef value)
      repeated .tensorflow.NodeDef node = 1;
    • addNode

      public GraphDef.Builder addNode(int index, NodeDef value)
      repeated .tensorflow.NodeDef node = 1;
    • addNode

      public GraphDef.Builder addNode(NodeDef.Builder builderForValue)
      repeated .tensorflow.NodeDef node = 1;
    • addNode

      public GraphDef.Builder addNode(int index, NodeDef.Builder builderForValue)
      repeated .tensorflow.NodeDef node = 1;
    • addAllNode

      public GraphDef.Builder addAllNode(Iterable<? extends NodeDef> values)
      repeated .tensorflow.NodeDef node = 1;
    • clearNode

      public GraphDef.Builder clearNode()
      repeated .tensorflow.NodeDef node = 1;
    • removeNode

      public GraphDef.Builder removeNode(int index)
      repeated .tensorflow.NodeDef node = 1;
    • getNodeBuilder

      public NodeDef.Builder getNodeBuilder(int index)
      repeated .tensorflow.NodeDef node = 1;
    • getNodeOrBuilder

      public NodeDefOrBuilder getNodeOrBuilder(int index)
      repeated .tensorflow.NodeDef node = 1;
      Specified by:
      getNodeOrBuilder in interface GraphDefOrBuilder
    • getNodeOrBuilderList

      public List<? extends NodeDefOrBuilder> getNodeOrBuilderList()
      repeated .tensorflow.NodeDef node = 1;
      Specified by:
      getNodeOrBuilderList in interface GraphDefOrBuilder
    • addNodeBuilder

      public NodeDef.Builder addNodeBuilder()
      repeated .tensorflow.NodeDef node = 1;
    • addNodeBuilder

      public NodeDef.Builder addNodeBuilder(int index)
      repeated .tensorflow.NodeDef node = 1;
    • getNodeBuilderList

      public List<NodeDef.Builder> getNodeBuilderList()
      repeated .tensorflow.NodeDef node = 1;
    • hasVersions

      public boolean hasVersions()
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
      Specified by:
      hasVersions in interface GraphDefOrBuilder
      Returns:
      Whether the versions field is set.
    • getVersions

      public VersionDef getVersions()
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
      Specified by:
      getVersions in interface GraphDefOrBuilder
      Returns:
      The versions.
    • setVersions

      public GraphDef.Builder setVersions(VersionDef value)
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
    • setVersions

      public GraphDef.Builder setVersions(VersionDef.Builder builderForValue)
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
    • mergeVersions

      public GraphDef.Builder mergeVersions(VersionDef value)
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
    • clearVersions

      public GraphDef.Builder clearVersions()
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
    • getVersionsBuilder

      public VersionDef.Builder getVersionsBuilder()
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
    • getVersionsOrBuilder

      public VersionDefOrBuilder getVersionsOrBuilder()
      Compatibility versions of the graph.  See core/public/version.h for version
      history.  The GraphDef version is distinct from the TensorFlow version, and
      each release of TensorFlow will support a range of GraphDef versions.
      
      .tensorflow.VersionDef versions = 4;
      Specified by:
      getVersionsOrBuilder in interface GraphDefOrBuilder
    • getVersion

      @Deprecated public int getVersion()
      Deprecated.
      tensorflow.GraphDef.version is deprecated. See tensorflow/core/framework/graph.proto;l=27
      Deprecated single version field; use versions above instead.  Since all
      GraphDef changes before "versions" was introduced were forward
      compatible, this field is entirely ignored.
      
      int32 version = 3 [deprecated = true];
      Specified by:
      getVersion in interface GraphDefOrBuilder
      Returns:
      The version.
    • setVersion

      @Deprecated public GraphDef.Builder setVersion(int value)
      Deprecated.
      tensorflow.GraphDef.version is deprecated. See tensorflow/core/framework/graph.proto;l=27
      Deprecated single version field; use versions above instead.  Since all
      GraphDef changes before "versions" was introduced were forward
      compatible, this field is entirely ignored.
      
      int32 version = 3 [deprecated = true];
      Parameters:
      value - The version to set.
      Returns:
      This builder for chaining.
    • clearVersion

      @Deprecated public GraphDef.Builder clearVersion()
      Deprecated.
      tensorflow.GraphDef.version is deprecated. See tensorflow/core/framework/graph.proto;l=27
      Deprecated single version field; use versions above instead.  Since all
      GraphDef changes before "versions" was introduced were forward
      compatible, this field is entirely ignored.
      
      int32 version = 3 [deprecated = true];
      Returns:
      This builder for chaining.
    • hasLibrary

      public boolean hasLibrary()
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
      Specified by:
      hasLibrary in interface GraphDefOrBuilder
      Returns:
      Whether the library field is set.
    • getLibrary

      public FunctionDefLibrary getLibrary()
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
      Specified by:
      getLibrary in interface GraphDefOrBuilder
      Returns:
      The library.
    • setLibrary

      public GraphDef.Builder setLibrary(FunctionDefLibrary value)
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
    • setLibrary

      public GraphDef.Builder setLibrary(FunctionDefLibrary.Builder builderForValue)
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
    • mergeLibrary

      public GraphDef.Builder mergeLibrary(FunctionDefLibrary value)
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
    • clearLibrary

      public GraphDef.Builder clearLibrary()
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
    • getLibraryBuilder

      public FunctionDefLibrary.Builder getLibraryBuilder()
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
    • getLibraryOrBuilder

      public FunctionDefLibraryOrBuilder getLibraryOrBuilder()
      "library" provides user-defined functions.
      Naming:
        * library.function.name are in a flat namespace.
          NOTE: We may need to change it to be hierarchical to support
          different orgs. E.g.,
          { "/google/nn", { ... }},
          { "/google/vision", { ... }}
          { "/org_foo/module_bar", { ... }}
          map<string, FunctionDefLib> named_lib;
        * If node[i].op is the name of one function in "library",
          node[i] is deemed as a function call. Otherwise, node[i].op
          must be a primitive operation supported by the runtime.
      Function call semantics:
        * The callee may start execution as soon as some of its inputs
          are ready. The caller may want to use Tuple() mechanism to
          ensure all inputs are ready in the same time.
        * The consumer of return values may start executing as soon as
          the return values the consumer depends on are ready.  The
          consumer may want to use Tuple() mechanism to ensure the
          consumer does not start until all return values of the callee
          function are ready.
      
      .tensorflow.FunctionDefLibrary library = 2;
      Specified by:
      getLibraryOrBuilder in interface GraphDefOrBuilder
    • hasDebugInfo

      public boolean hasDebugInfo()
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
      Specified by:
      hasDebugInfo in interface GraphDefOrBuilder
      Returns:
      Whether the debugInfo field is set.
    • getDebugInfo

      public GraphDebugInfo getDebugInfo()
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
      Specified by:
      getDebugInfo in interface GraphDefOrBuilder
      Returns:
      The debugInfo.
    • setDebugInfo

      public GraphDef.Builder setDebugInfo(GraphDebugInfo value)
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
    • setDebugInfo

      public GraphDef.Builder setDebugInfo(GraphDebugInfo.Builder builderForValue)
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
    • mergeDebugInfo

      public GraphDef.Builder mergeDebugInfo(GraphDebugInfo value)
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
    • clearDebugInfo

      public GraphDef.Builder clearDebugInfo()
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
    • getDebugInfoBuilder

      public GraphDebugInfo.Builder getDebugInfoBuilder()
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
    • getDebugInfoOrBuilder

      public GraphDebugInfoOrBuilder getDebugInfoOrBuilder()
      Stack traces for the nodes in this graph.
      
      .tensorflow.GraphDebugInfo debug_info = 5;
      Specified by:
      getDebugInfoOrBuilder in interface GraphDefOrBuilder
    • setUnknownFields

      public final GraphDef.Builder setUnknownFields(UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface Message.Builder
      Overrides:
      setUnknownFields in class GeneratedMessageV3.Builder<GraphDef.Builder>
    • mergeUnknownFields

      public final GraphDef.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface Message.Builder
      Overrides:
      mergeUnknownFields in class GeneratedMessageV3.Builder<GraphDef.Builder>