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

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

There is a newer version: 1.0.0-M2.1
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/framework/function.proto

package org.tensorflow.framework;

/**
 * 
 * A function can be instantiated when the runtime can bind every attr
 * with a value. When a GraphDef has a call to a function, it must
 * have binding for every attr defined in the signature.
 * TODO(zhifengc):
 *   * device spec, etc.
 * 
* * Protobuf type {@code tensorflow.FunctionDef} */ public final class FunctionDef extends org.nd4j.shade.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:tensorflow.FunctionDef) FunctionDefOrBuilder { private static final long serialVersionUID = 0L; // Use FunctionDef.newBuilder() to construct. private FunctionDef(org.nd4j.shade.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private FunctionDef() { nodeDef_ = java.util.Collections.emptyList(); } @java.lang.Override public final org.nd4j.shade.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private FunctionDef( org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; org.nd4j.shade.protobuf.UnknownFieldSet.Builder unknownFields = org.nd4j.shade.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: { org.tensorflow.framework.OpDef.Builder subBuilder = null; if (signature_ != null) { subBuilder = signature_.toBuilder(); } signature_ = input.readMessage(org.tensorflow.framework.OpDef.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(signature_); signature_ = subBuilder.buildPartial(); } break; } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { nodeDef_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } nodeDef_.add( input.readMessage(org.tensorflow.framework.NodeDef.parser(), extensionRegistry)); break; } case 34: { if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { ret_ = org.nd4j.shade.protobuf.MapField.newMapField( RetDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000008; } org.nd4j.shade.protobuf.MapEntry ret__ = input.readMessage( RetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); ret_.getMutableMap().put( ret__.getKey(), ret__.getValue()); break; } case 42: { if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { attr_ = org.nd4j.shade.protobuf.MapField.newMapField( AttrDefaultEntryHolder.defaultEntry); mutable_bitField0_ |= 0x00000002; } org.nd4j.shade.protobuf.MapEntry attr__ = input.readMessage( AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); attr_.getMutableMap().put( attr__.getKey(), attr__.getValue()); break; } } } } catch (org.nd4j.shade.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new org.nd4j.shade.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor() { return org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; } @SuppressWarnings({"rawtypes"}) protected org.nd4j.shade.protobuf.MapField internalGetMapField( int number) { switch (number) { case 5: return internalGetAttr(); case 4: return internalGetRet(); default: throw new RuntimeException( "Invalid map field number: " + number); } } protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable .ensureFieldAccessorsInitialized( org.tensorflow.framework.FunctionDef.class, org.tensorflow.framework.FunctionDef.Builder.class); } private int bitField0_; public static final int SIGNATURE_FIELD_NUMBER = 1; private org.tensorflow.framework.OpDef signature_; /** *
   * The definition of the function's name, arguments, return values,
   * attrs etc.
   * 
* * .tensorflow.OpDef signature = 1; */ public boolean hasSignature() { return signature_ != null; } /** *
   * The definition of the function's name, arguments, return values,
   * attrs etc.
   * 
* * .tensorflow.OpDef signature = 1; */ public org.tensorflow.framework.OpDef getSignature() { return signature_ == null ? org.tensorflow.framework.OpDef.getDefaultInstance() : signature_; } /** *
   * The definition of the function's name, arguments, return values,
   * attrs etc.
   * 
* * .tensorflow.OpDef signature = 1; */ public org.tensorflow.framework.OpDefOrBuilder getSignatureOrBuilder() { return getSignature(); } public static final int ATTR_FIELD_NUMBER = 5; private static final class AttrDefaultEntryHolder { static final org.nd4j.shade.protobuf.MapEntry< java.lang.String, org.tensorflow.framework.AttrValue> defaultEntry = org.nd4j.shade.protobuf.MapEntry .newDefaultInstance( org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_AttrEntry_descriptor, org.nd4j.shade.protobuf.WireFormat.FieldType.STRING, "", org.nd4j.shade.protobuf.WireFormat.FieldType.MESSAGE, org.tensorflow.framework.AttrValue.getDefaultInstance()); } private org.nd4j.shade.protobuf.MapField< java.lang.String, org.tensorflow.framework.AttrValue> attr_; private org.nd4j.shade.protobuf.MapField internalGetAttr() { if (attr_ == null) { return org.nd4j.shade.protobuf.MapField.emptyMapField( AttrDefaultEntryHolder.defaultEntry); } return attr_; } public int getAttrCount() { return internalGetAttr().getMap().size(); } /** *
   * Attributes specific to this function definition.
   * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public boolean containsAttr( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetAttr().getMap().containsKey(key); } /** * Use {@link #getAttrMap()} instead. */ @java.lang.Deprecated public java.util.Map getAttr() { return getAttrMap(); } /** *
   * Attributes specific to this function definition.
   * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public java.util.Map getAttrMap() { return internalGetAttr().getMap(); } /** *
   * Attributes specific to this function definition.
   * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public org.tensorflow.framework.AttrValue getAttrOrDefault( java.lang.String key, org.tensorflow.framework.AttrValue defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetAttr().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
   * Attributes specific to this function definition.
   * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public org.tensorflow.framework.AttrValue getAttrOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetAttr().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int NODE_DEF_FIELD_NUMBER = 3; private java.util.List nodeDef_; /** *
   * By convention, "op" in node_def is resolved by consulting with a
   * user-defined library first. If not resolved, "func" is assumed to
   * be a builtin op.
   * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public java.util.List getNodeDefList() { return nodeDef_; } /** *
   * By convention, "op" in node_def is resolved by consulting with a
   * user-defined library first. If not resolved, "func" is assumed to
   * be a builtin op.
   * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public java.util.List getNodeDefOrBuilderList() { return nodeDef_; } /** *
   * By convention, "op" in node_def is resolved by consulting with a
   * user-defined library first. If not resolved, "func" is assumed to
   * be a builtin op.
   * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public int getNodeDefCount() { return nodeDef_.size(); } /** *
   * By convention, "op" in node_def is resolved by consulting with a
   * user-defined library first. If not resolved, "func" is assumed to
   * be a builtin op.
   * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDef getNodeDef(int index) { return nodeDef_.get(index); } /** *
   * By convention, "op" in node_def is resolved by consulting with a
   * user-defined library first. If not resolved, "func" is assumed to
   * be a builtin op.
   * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDefOrBuilder getNodeDefOrBuilder( int index) { return nodeDef_.get(index); } public static final int RET_FIELD_NUMBER = 4; private static final class RetDefaultEntryHolder { static final org.nd4j.shade.protobuf.MapEntry< java.lang.String, java.lang.String> defaultEntry = org.nd4j.shade.protobuf.MapEntry .newDefaultInstance( org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_RetEntry_descriptor, org.nd4j.shade.protobuf.WireFormat.FieldType.STRING, "", org.nd4j.shade.protobuf.WireFormat.FieldType.STRING, ""); } private org.nd4j.shade.protobuf.MapField< java.lang.String, java.lang.String> ret_; private org.nd4j.shade.protobuf.MapField internalGetRet() { if (ret_ == null) { return org.nd4j.shade.protobuf.MapField.emptyMapField( RetDefaultEntryHolder.defaultEntry); } return ret_; } public int getRetCount() { return internalGetRet().getMap().size(); } /** *
   * A mapping from the output arg names from `signature` to the
   * outputs from `node_def` that should be returned by the function.
   * 
* * map<string, string> ret = 4; */ public boolean containsRet( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetRet().getMap().containsKey(key); } /** * Use {@link #getRetMap()} instead. */ @java.lang.Deprecated public java.util.Map getRet() { return getRetMap(); } /** *
   * A mapping from the output arg names from `signature` to the
   * outputs from `node_def` that should be returned by the function.
   * 
* * map<string, string> ret = 4; */ public java.util.Map getRetMap() { return internalGetRet().getMap(); } /** *
   * A mapping from the output arg names from `signature` to the
   * outputs from `node_def` that should be returned by the function.
   * 
* * map<string, string> ret = 4; */ public java.lang.String getRetOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetRet().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
   * A mapping from the output arg names from `signature` to the
   * outputs from `node_def` that should be returned by the function.
   * 
* * map<string, string> ret = 4; */ public java.lang.String getRetOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetRet().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(org.nd4j.shade.protobuf.CodedOutputStream output) throws java.io.IOException { if (signature_ != null) { output.writeMessage(1, getSignature()); } for (int i = 0; i < nodeDef_.size(); i++) { output.writeMessage(3, nodeDef_.get(i)); } org.nd4j.shade.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetRet(), RetDefaultEntryHolder.defaultEntry, 4); org.nd4j.shade.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetAttr(), AttrDefaultEntryHolder.defaultEntry, 5); unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (signature_ != null) { size += org.nd4j.shade.protobuf.CodedOutputStream .computeMessageSize(1, getSignature()); } for (int i = 0; i < nodeDef_.size(); i++) { size += org.nd4j.shade.protobuf.CodedOutputStream .computeMessageSize(3, nodeDef_.get(i)); } for (java.util.Map.Entry entry : internalGetRet().getMap().entrySet()) { org.nd4j.shade.protobuf.MapEntry ret__ = RetDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += org.nd4j.shade.protobuf.CodedOutputStream .computeMessageSize(4, ret__); } for (java.util.Map.Entry entry : internalGetAttr().getMap().entrySet()) { org.nd4j.shade.protobuf.MapEntry attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += org.nd4j.shade.protobuf.CodedOutputStream .computeMessageSize(5, attr__); } 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.FunctionDef)) { return super.equals(obj); } org.tensorflow.framework.FunctionDef other = (org.tensorflow.framework.FunctionDef) obj; boolean result = true; result = result && (hasSignature() == other.hasSignature()); if (hasSignature()) { result = result && getSignature() .equals(other.getSignature()); } result = result && internalGetAttr().equals( other.internalGetAttr()); result = result && getNodeDefList() .equals(other.getNodeDefList()); result = result && internalGetRet().equals( other.internalGetRet()); 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(); if (hasSignature()) { hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getSignature().hashCode(); } if (!internalGetAttr().getMap().isEmpty()) { hash = (37 * hash) + ATTR_FIELD_NUMBER; hash = (53 * hash) + internalGetAttr().hashCode(); } if (getNodeDefCount() > 0) { hash = (37 * hash) + NODE_DEF_FIELD_NUMBER; hash = (53 * hash) + getNodeDefList().hashCode(); } if (!internalGetRet().getMap().isEmpty()) { hash = (37 * hash) + RET_FIELD_NUMBER; hash = (53 * hash) + internalGetRet().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static org.tensorflow.framework.FunctionDef parseFrom( java.nio.ByteBuffer data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.framework.FunctionDef parseFrom( java.nio.ByteBuffer data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.framework.FunctionDef parseFrom( org.nd4j.shade.protobuf.ByteString data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.framework.FunctionDef parseFrom( org.nd4j.shade.protobuf.ByteString data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.framework.FunctionDef parseFrom(byte[] data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static org.tensorflow.framework.FunctionDef parseFrom( byte[] data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static org.tensorflow.framework.FunctionDef parseFrom(java.io.InputStream input) throws java.io.IOException { return org.nd4j.shade.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.tensorflow.framework.FunctionDef parseFrom( java.io.InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return org.nd4j.shade.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static org.tensorflow.framework.FunctionDef parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return org.nd4j.shade.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static org.tensorflow.framework.FunctionDef parseDelimitedFrom( java.io.InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return org.nd4j.shade.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.tensorflow.framework.FunctionDef parseFrom( org.nd4j.shade.protobuf.CodedInputStream input) throws java.io.IOException { return org.nd4j.shade.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static org.tensorflow.framework.FunctionDef parseFrom( org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return org.nd4j.shade.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.FunctionDef 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( org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * A function can be instantiated when the runtime can bind every attr
   * with a value. When a GraphDef has a call to a function, it must
   * have binding for every attr defined in the signature.
   * TODO(zhifengc):
   *   * device spec, etc.
   * 
* * Protobuf type {@code tensorflow.FunctionDef} */ public static final class Builder extends org.nd4j.shade.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:tensorflow.FunctionDef) org.tensorflow.framework.FunctionDefOrBuilder { public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor() { return org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; } @SuppressWarnings({"rawtypes"}) protected org.nd4j.shade.protobuf.MapField internalGetMapField( int number) { switch (number) { case 5: return internalGetAttr(); case 4: return internalGetRet(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected org.nd4j.shade.protobuf.MapField internalGetMutableMapField( int number) { switch (number) { case 5: return internalGetMutableAttr(); case 4: return internalGetMutableRet(); default: throw new RuntimeException( "Invalid map field number: " + number); } } protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_fieldAccessorTable .ensureFieldAccessorsInitialized( org.tensorflow.framework.FunctionDef.class, org.tensorflow.framework.FunctionDef.Builder.class); } // Construct using org.tensorflow.framework.FunctionDef.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (org.nd4j.shade.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getNodeDefFieldBuilder(); } } public Builder clear() { super.clear(); if (signatureBuilder_ == null) { signature_ = null; } else { signature_ = null; signatureBuilder_ = null; } internalGetMutableAttr().clear(); if (nodeDefBuilder_ == null) { nodeDef_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { nodeDefBuilder_.clear(); } internalGetMutableRet().clear(); return this; } public org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptorForType() { return org.tensorflow.framework.FunctionProtos.internal_static_tensorflow_FunctionDef_descriptor; } public org.tensorflow.framework.FunctionDef getDefaultInstanceForType() { return org.tensorflow.framework.FunctionDef.getDefaultInstance(); } public org.tensorflow.framework.FunctionDef build() { org.tensorflow.framework.FunctionDef result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public org.tensorflow.framework.FunctionDef buildPartial() { org.tensorflow.framework.FunctionDef result = new org.tensorflow.framework.FunctionDef(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (signatureBuilder_ == null) { result.signature_ = signature_; } else { result.signature_ = signatureBuilder_.build(); } result.attr_ = internalGetAttr(); result.attr_.makeImmutable(); if (nodeDefBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_); bitField0_ = (bitField0_ & ~0x00000004); } result.nodeDef_ = nodeDef_; } else { result.nodeDef_ = nodeDefBuilder_.build(); } result.ret_ = internalGetRet(); result.ret_.makeImmutable(); result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } public Builder clearField( org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(org.nd4j.shade.protobuf.Message other) { if (other instanceof org.tensorflow.framework.FunctionDef) { return mergeFrom((org.tensorflow.framework.FunctionDef)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(org.tensorflow.framework.FunctionDef other) { if (other == org.tensorflow.framework.FunctionDef.getDefaultInstance()) return this; if (other.hasSignature()) { mergeSignature(other.getSignature()); } internalGetMutableAttr().mergeFrom( other.internalGetAttr()); if (nodeDefBuilder_ == null) { if (!other.nodeDef_.isEmpty()) { if (nodeDef_.isEmpty()) { nodeDef_ = other.nodeDef_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureNodeDefIsMutable(); nodeDef_.addAll(other.nodeDef_); } onChanged(); } } else { if (!other.nodeDef_.isEmpty()) { if (nodeDefBuilder_.isEmpty()) { nodeDefBuilder_.dispose(); nodeDefBuilder_ = null; nodeDef_ = other.nodeDef_; bitField0_ = (bitField0_ & ~0x00000004); nodeDefBuilder_ = org.nd4j.shade.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getNodeDefFieldBuilder() : null; } else { nodeDefBuilder_.addAllMessages(other.nodeDef_); } } } internalGetMutableRet().mergeFrom( other.internalGetRet()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.tensorflow.framework.FunctionDef parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.nd4j.shade.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.tensorflow.framework.FunctionDef) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private org.tensorflow.framework.OpDef signature_ = null; private org.nd4j.shade.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.OpDef, org.tensorflow.framework.OpDef.Builder, org.tensorflow.framework.OpDefOrBuilder> signatureBuilder_; /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public boolean hasSignature() { return signatureBuilder_ != null || signature_ != null; } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public org.tensorflow.framework.OpDef getSignature() { if (signatureBuilder_ == null) { return signature_ == null ? org.tensorflow.framework.OpDef.getDefaultInstance() : signature_; } else { return signatureBuilder_.getMessage(); } } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public Builder setSignature(org.tensorflow.framework.OpDef value) { if (signatureBuilder_ == null) { if (value == null) { throw new NullPointerException(); } signature_ = value; onChanged(); } else { signatureBuilder_.setMessage(value); } return this; } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public Builder setSignature( org.tensorflow.framework.OpDef.Builder builderForValue) { if (signatureBuilder_ == null) { signature_ = builderForValue.build(); onChanged(); } else { signatureBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public Builder mergeSignature(org.tensorflow.framework.OpDef value) { if (signatureBuilder_ == null) { if (signature_ != null) { signature_ = org.tensorflow.framework.OpDef.newBuilder(signature_).mergeFrom(value).buildPartial(); } else { signature_ = value; } onChanged(); } else { signatureBuilder_.mergeFrom(value); } return this; } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public Builder clearSignature() { if (signatureBuilder_ == null) { signature_ = null; onChanged(); } else { signature_ = null; signatureBuilder_ = null; } return this; } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public org.tensorflow.framework.OpDef.Builder getSignatureBuilder() { onChanged(); return getSignatureFieldBuilder().getBuilder(); } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ public org.tensorflow.framework.OpDefOrBuilder getSignatureOrBuilder() { if (signatureBuilder_ != null) { return signatureBuilder_.getMessageOrBuilder(); } else { return signature_ == null ? org.tensorflow.framework.OpDef.getDefaultInstance() : signature_; } } /** *
     * The definition of the function's name, arguments, return values,
     * attrs etc.
     * 
* * .tensorflow.OpDef signature = 1; */ private org.nd4j.shade.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.OpDef, org.tensorflow.framework.OpDef.Builder, org.tensorflow.framework.OpDefOrBuilder> getSignatureFieldBuilder() { if (signatureBuilder_ == null) { signatureBuilder_ = new org.nd4j.shade.protobuf.SingleFieldBuilderV3< org.tensorflow.framework.OpDef, org.tensorflow.framework.OpDef.Builder, org.tensorflow.framework.OpDefOrBuilder>( getSignature(), getParentForChildren(), isClean()); signature_ = null; } return signatureBuilder_; } private org.nd4j.shade.protobuf.MapField< java.lang.String, org.tensorflow.framework.AttrValue> attr_; private org.nd4j.shade.protobuf.MapField internalGetAttr() { if (attr_ == null) { return org.nd4j.shade.protobuf.MapField.emptyMapField( AttrDefaultEntryHolder.defaultEntry); } return attr_; } private org.nd4j.shade.protobuf.MapField internalGetMutableAttr() { onChanged();; if (attr_ == null) { attr_ = org.nd4j.shade.protobuf.MapField.newMapField( AttrDefaultEntryHolder.defaultEntry); } if (!attr_.isMutable()) { attr_ = attr_.copy(); } return attr_; } public int getAttrCount() { return internalGetAttr().getMap().size(); } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public boolean containsAttr( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetAttr().getMap().containsKey(key); } /** * Use {@link #getAttrMap()} instead. */ @java.lang.Deprecated public java.util.Map getAttr() { return getAttrMap(); } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public java.util.Map getAttrMap() { return internalGetAttr().getMap(); } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public org.tensorflow.framework.AttrValue getAttrOrDefault( java.lang.String key, org.tensorflow.framework.AttrValue defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetAttr().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public org.tensorflow.framework.AttrValue getAttrOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetAttr().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearAttr() { internalGetMutableAttr().getMutableMap() .clear(); return this; } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public Builder removeAttr( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableAttr().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableAttr() { return internalGetMutableAttr().getMutableMap(); } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public Builder putAttr( 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(); } internalGetMutableAttr().getMutableMap() .put(key, value); return this; } /** *
     * Attributes specific to this function definition.
     * 
* * map<string, .tensorflow.AttrValue> attr = 5; */ public Builder putAllAttr( java.util.Map values) { internalGetMutableAttr().getMutableMap() .putAll(values); return this; } private java.util.List nodeDef_ = java.util.Collections.emptyList(); private void ensureNodeDefIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { nodeDef_ = new java.util.ArrayList(nodeDef_); bitField0_ |= 0x00000004; } } private org.nd4j.shade.protobuf.RepeatedFieldBuilderV3< org.tensorflow.framework.NodeDef, org.tensorflow.framework.NodeDef.Builder, org.tensorflow.framework.NodeDefOrBuilder> nodeDefBuilder_; /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public java.util.List getNodeDefList() { if (nodeDefBuilder_ == null) { return java.util.Collections.unmodifiableList(nodeDef_); } else { return nodeDefBuilder_.getMessageList(); } } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public int getNodeDefCount() { if (nodeDefBuilder_ == null) { return nodeDef_.size(); } else { return nodeDefBuilder_.getCount(); } } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDef getNodeDef(int index) { if (nodeDefBuilder_ == null) { return nodeDef_.get(index); } else { return nodeDefBuilder_.getMessage(index); } } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder setNodeDef( int index, org.tensorflow.framework.NodeDef value) { if (nodeDefBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeDefIsMutable(); nodeDef_.set(index, value); onChanged(); } else { nodeDefBuilder_.setMessage(index, value); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder setNodeDef( int index, org.tensorflow.framework.NodeDef.Builder builderForValue) { if (nodeDefBuilder_ == null) { ensureNodeDefIsMutable(); nodeDef_.set(index, builderForValue.build()); onChanged(); } else { nodeDefBuilder_.setMessage(index, builderForValue.build()); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder addNodeDef(org.tensorflow.framework.NodeDef value) { if (nodeDefBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeDefIsMutable(); nodeDef_.add(value); onChanged(); } else { nodeDefBuilder_.addMessage(value); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder addNodeDef( int index, org.tensorflow.framework.NodeDef value) { if (nodeDefBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureNodeDefIsMutable(); nodeDef_.add(index, value); onChanged(); } else { nodeDefBuilder_.addMessage(index, value); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder addNodeDef( org.tensorflow.framework.NodeDef.Builder builderForValue) { if (nodeDefBuilder_ == null) { ensureNodeDefIsMutable(); nodeDef_.add(builderForValue.build()); onChanged(); } else { nodeDefBuilder_.addMessage(builderForValue.build()); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder addNodeDef( int index, org.tensorflow.framework.NodeDef.Builder builderForValue) { if (nodeDefBuilder_ == null) { ensureNodeDefIsMutable(); nodeDef_.add(index, builderForValue.build()); onChanged(); } else { nodeDefBuilder_.addMessage(index, builderForValue.build()); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder addAllNodeDef( java.lang.Iterable values) { if (nodeDefBuilder_ == null) { ensureNodeDefIsMutable(); org.nd4j.shade.protobuf.AbstractMessageLite.Builder.addAll( values, nodeDef_); onChanged(); } else { nodeDefBuilder_.addAllMessages(values); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder clearNodeDef() { if (nodeDefBuilder_ == null) { nodeDef_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { nodeDefBuilder_.clear(); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public Builder removeNodeDef(int index) { if (nodeDefBuilder_ == null) { ensureNodeDefIsMutable(); nodeDef_.remove(index); onChanged(); } else { nodeDefBuilder_.remove(index); } return this; } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDef.Builder getNodeDefBuilder( int index) { return getNodeDefFieldBuilder().getBuilder(index); } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDefOrBuilder getNodeDefOrBuilder( int index) { if (nodeDefBuilder_ == null) { return nodeDef_.get(index); } else { return nodeDefBuilder_.getMessageOrBuilder(index); } } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public java.util.List getNodeDefOrBuilderList() { if (nodeDefBuilder_ != null) { return nodeDefBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(nodeDef_); } } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDef.Builder addNodeDefBuilder() { return getNodeDefFieldBuilder().addBuilder( org.tensorflow.framework.NodeDef.getDefaultInstance()); } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public org.tensorflow.framework.NodeDef.Builder addNodeDefBuilder( int index) { return getNodeDefFieldBuilder().addBuilder( index, org.tensorflow.framework.NodeDef.getDefaultInstance()); } /** *
     * By convention, "op" in node_def is resolved by consulting with a
     * user-defined library first. If not resolved, "func" is assumed to
     * be a builtin op.
     * 
* * repeated .tensorflow.NodeDef node_def = 3; */ public java.util.List getNodeDefBuilderList() { return getNodeDefFieldBuilder().getBuilderList(); } private org.nd4j.shade.protobuf.RepeatedFieldBuilderV3< org.tensorflow.framework.NodeDef, org.tensorflow.framework.NodeDef.Builder, org.tensorflow.framework.NodeDefOrBuilder> getNodeDefFieldBuilder() { if (nodeDefBuilder_ == null) { nodeDefBuilder_ = new org.nd4j.shade.protobuf.RepeatedFieldBuilderV3< org.tensorflow.framework.NodeDef, org.tensorflow.framework.NodeDef.Builder, org.tensorflow.framework.NodeDefOrBuilder>( nodeDef_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), isClean()); nodeDef_ = null; } return nodeDefBuilder_; } private org.nd4j.shade.protobuf.MapField< java.lang.String, java.lang.String> ret_; private org.nd4j.shade.protobuf.MapField internalGetRet() { if (ret_ == null) { return org.nd4j.shade.protobuf.MapField.emptyMapField( RetDefaultEntryHolder.defaultEntry); } return ret_; } private org.nd4j.shade.protobuf.MapField internalGetMutableRet() { onChanged();; if (ret_ == null) { ret_ = org.nd4j.shade.protobuf.MapField.newMapField( RetDefaultEntryHolder.defaultEntry); } if (!ret_.isMutable()) { ret_ = ret_.copy(); } return ret_; } public int getRetCount() { return internalGetRet().getMap().size(); } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public boolean containsRet( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetRet().getMap().containsKey(key); } /** * Use {@link #getRetMap()} instead. */ @java.lang.Deprecated public java.util.Map getRet() { return getRetMap(); } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public java.util.Map getRetMap() { return internalGetRet().getMap(); } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public java.lang.String getRetOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetRet().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public java.lang.String getRetOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map map = internalGetRet().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearRet() { internalGetMutableRet().getMutableMap() .clear(); return this; } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public Builder removeRet( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } internalGetMutableRet().getMutableMap() .remove(key); return this; } /** * Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableRet() { return internalGetMutableRet().getMutableMap(); } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public Builder putRet( java.lang.String key, java.lang.String value) { if (key == null) { throw new java.lang.NullPointerException(); } if (value == null) { throw new java.lang.NullPointerException(); } internalGetMutableRet().getMutableMap() .put(key, value); return this; } /** *
     * A mapping from the output arg names from `signature` to the
     * outputs from `node_def` that should be returned by the function.
     * 
* * map<string, string> ret = 4; */ public Builder putAllRet( java.util.Map values) { internalGetMutableRet().getMutableMap() .putAll(values); return this; } public final Builder setUnknownFields( final org.nd4j.shade.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final org.nd4j.shade.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:tensorflow.FunctionDef) } // @@protoc_insertion_point(class_scope:tensorflow.FunctionDef) private static final org.tensorflow.framework.FunctionDef DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new org.tensorflow.framework.FunctionDef(); } public static org.tensorflow.framework.FunctionDef getDefaultInstance() { return DEFAULT_INSTANCE; } private static final org.nd4j.shade.protobuf.Parser PARSER = new org.nd4j.shade.protobuf.AbstractParser() { public FunctionDef parsePartialFrom( org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException { return new FunctionDef(input, extensionRegistry); } }; public static org.nd4j.shade.protobuf.Parser parser() { return PARSER; } @java.lang.Override public org.nd4j.shade.protobuf.Parser getParserForType() { return PARSER; } public org.tensorflow.framework.FunctionDef getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy