Package org.tensorflow.framework
Class CollectionDef
- java.lang.Object
-
- org.nd4j.shade.protobuf.AbstractMessageLite
-
- org.nd4j.shade.protobuf.AbstractMessage
-
- org.nd4j.shade.protobuf.GeneratedMessageV3
-
- org.tensorflow.framework.CollectionDef
-
- All Implemented Interfaces:
Serializable,org.nd4j.shade.protobuf.Message,org.nd4j.shade.protobuf.MessageLite,org.nd4j.shade.protobuf.MessageLiteOrBuilder,org.nd4j.shade.protobuf.MessageOrBuilder,CollectionDefOrBuilder
public final class CollectionDef extends org.nd4j.shade.protobuf.GeneratedMessageV3 implements CollectionDefOrBuilder
CollectionDef should cover most collections. To add a user-defined collection, do one of the following: 1. For simple data types, such as string, int, float: tf.add_to_collection("your_collection_name", your_simple_value) strings will be stored as bytes_list. 2. For Protobuf types, there are three ways to add them: 1) tf.add_to_collection("your_collection_name", your_proto.SerializeToString()) collection_def { key: "user_defined_bytes_collection" value { bytes_list { value: "queue_name: \"test_queue\"\n" } } } or 2) tf.add_to_collection("your_collection_name", str(your_proto)) collection_def { key: "user_defined_string_collection" value { bytes_list { value: "\n\ntest_queue" } } } or 3) any_buf = any_pb2.Any() tf.add_to_collection("your_collection_name", any_buf.Pack(your_proto)) collection_def { key: "user_defined_any_collection" value { any_list { value { type_url: "type.googleapis.com/tensorflow.QueueRunnerDef" value: "\n\ntest_queue" } } } } 3. For Python objects, implement to_proto() and from_proto(), and register them in the following manner: ops.register_proto_function("your_collection_name", proto_type, to_proto=YourPythonObject.to_proto, from_proto=YourPythonObject.from_proto) These functions will be invoked to serialize and de-serialize the collection. For example, ops.register_proto_function(ops.GraphKeys.GLOBAL_VARIABLES, proto_type=variable_pb2.VariableDef, to_proto=Variable.to_proto, from_proto=Variable.from_proto)Protobuf typetensorflow.CollectionDef- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCollectionDef.AnyListAnyList is used for collecting Any protos.static interfaceCollectionDef.AnyListOrBuilderstatic classCollectionDef.BuilderCollectionDef should cover most collections.static classCollectionDef.BytesListBytesList is used for collecting strings and serialized protobufs.static interfaceCollectionDef.BytesListOrBuilderstatic classCollectionDef.FloatListFloatList is used for collecting float values.static interfaceCollectionDef.FloatListOrBuilderstatic classCollectionDef.Int64ListInt64List is used for collecting int, int64 and long values.static interfaceCollectionDef.Int64ListOrBuilderstatic classCollectionDef.KindCasestatic classCollectionDef.NodeListNodeList is used for collecting nodes in graph.static interfaceCollectionDef.NodeListOrBuilder-
Nested classes/interfaces inherited from class org.nd4j.shade.protobuf.GeneratedMessageV3
org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage>, org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends org.nd4j.shade.protobuf.GeneratedMessageV3.ExtendableMessage>, org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable, org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intANY_LIST_FIELD_NUMBERstatic intBYTES_LIST_FIELD_NUMBERstatic intFLOAT_LIST_FIELD_NUMBERstatic intINT64_LIST_FIELD_NUMBERstatic intNODE_LIST_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)CollectionDef.AnyListgetAnyList().tensorflow.CollectionDef.AnyList any_list = 5;CollectionDef.AnyListOrBuildergetAnyListOrBuilder().tensorflow.CollectionDef.AnyList any_list = 5;CollectionDef.BytesListgetBytesList().tensorflow.CollectionDef.BytesList bytes_list = 2;CollectionDef.BytesListOrBuildergetBytesListOrBuilder().tensorflow.CollectionDef.BytesList bytes_list = 2;static CollectionDefgetDefaultInstance()CollectionDefgetDefaultInstanceForType()static org.nd4j.shade.protobuf.Descriptors.DescriptorgetDescriptor()CollectionDef.FloatListgetFloatList().tensorflow.CollectionDef.FloatList float_list = 4;CollectionDef.FloatListOrBuildergetFloatListOrBuilder().tensorflow.CollectionDef.FloatList float_list = 4;CollectionDef.Int64ListgetInt64List().tensorflow.CollectionDef.Int64List int64_list = 3;CollectionDef.Int64ListOrBuildergetInt64ListOrBuilder().tensorflow.CollectionDef.Int64List int64_list = 3;CollectionDef.KindCasegetKindCase()CollectionDef.NodeListgetNodeList().tensorflow.CollectionDef.NodeList node_list = 1;CollectionDef.NodeListOrBuildergetNodeListOrBuilder().tensorflow.CollectionDef.NodeList node_list = 1;org.nd4j.shade.protobuf.Parser<CollectionDef>getParserForType()intgetSerializedSize()org.nd4j.shade.protobuf.UnknownFieldSetgetUnknownFields()booleanhasAnyList().tensorflow.CollectionDef.AnyList any_list = 5;booleanhasBytesList().tensorflow.CollectionDef.BytesList bytes_list = 2;booleanhasFloatList().tensorflow.CollectionDef.FloatList float_list = 4;inthashCode()booleanhasInt64List().tensorflow.CollectionDef.Int64List int64_list = 3;booleanhasNodeList().tensorflow.CollectionDef.NodeList node_list = 1;protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static CollectionDef.BuildernewBuilder()static CollectionDef.BuildernewBuilder(CollectionDef prototype)CollectionDef.BuildernewBuilderForType()protected CollectionDef.BuildernewBuilderForType(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static CollectionDefparseDelimitedFrom(InputStream input)static CollectionDefparseDelimitedFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static CollectionDefparseFrom(byte[] data)static CollectionDefparseFrom(byte[] data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static CollectionDefparseFrom(InputStream input)static CollectionDefparseFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static CollectionDefparseFrom(ByteBuffer data)static CollectionDefparseFrom(ByteBuffer data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static CollectionDefparseFrom(org.nd4j.shade.protobuf.ByteString data)static CollectionDefparseFrom(org.nd4j.shade.protobuf.ByteString data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static CollectionDefparseFrom(org.nd4j.shade.protobuf.CodedInputStream input)static CollectionDefparseFrom(org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)static org.nd4j.shade.protobuf.Parser<CollectionDef>parser()CollectionDef.BuildertoBuilder()voidwriteTo(org.nd4j.shade.protobuf.CodedOutputStream output)-
Methods inherited from class org.nd4j.shade.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class org.nd4j.shade.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class org.nd4j.shade.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
NODE_LIST_FIELD_NUMBER
public static final int NODE_LIST_FIELD_NUMBER
- See Also:
- Constant Field Values
-
BYTES_LIST_FIELD_NUMBER
public static final int BYTES_LIST_FIELD_NUMBER
- See Also:
- Constant Field Values
-
INT64_LIST_FIELD_NUMBER
public static final int INT64_LIST_FIELD_NUMBER
- See Also:
- Constant Field Values
-
FLOAT_LIST_FIELD_NUMBER
public static final int FLOAT_LIST_FIELD_NUMBER
- See Also:
- Constant Field Values
-
ANY_LIST_FIELD_NUMBER
public static final int ANY_LIST_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getUnknownFields
public final org.nd4j.shade.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfaceorg.nd4j.shade.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDescriptor
public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getKindCase
public CollectionDef.KindCase getKindCase()
- Specified by:
getKindCasein interfaceCollectionDefOrBuilder
-
hasNodeList
public boolean hasNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1;- Specified by:
hasNodeListin interfaceCollectionDefOrBuilder- Returns:
- Whether the nodeList field is set.
-
getNodeList
public CollectionDef.NodeList getNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1;- Specified by:
getNodeListin interfaceCollectionDefOrBuilder- Returns:
- The nodeList.
-
getNodeListOrBuilder
public CollectionDef.NodeListOrBuilder getNodeListOrBuilder()
.tensorflow.CollectionDef.NodeList node_list = 1;- Specified by:
getNodeListOrBuilderin interfaceCollectionDefOrBuilder
-
hasBytesList
public boolean hasBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2;- Specified by:
hasBytesListin interfaceCollectionDefOrBuilder- Returns:
- Whether the bytesList field is set.
-
getBytesList
public CollectionDef.BytesList getBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2;- Specified by:
getBytesListin interfaceCollectionDefOrBuilder- Returns:
- The bytesList.
-
getBytesListOrBuilder
public CollectionDef.BytesListOrBuilder getBytesListOrBuilder()
.tensorflow.CollectionDef.BytesList bytes_list = 2;- Specified by:
getBytesListOrBuilderin interfaceCollectionDefOrBuilder
-
hasInt64List
public boolean hasInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3;- Specified by:
hasInt64Listin interfaceCollectionDefOrBuilder- Returns:
- Whether the int64List field is set.
-
getInt64List
public CollectionDef.Int64List getInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3;- Specified by:
getInt64Listin interfaceCollectionDefOrBuilder- Returns:
- The int64List.
-
getInt64ListOrBuilder
public CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder()
.tensorflow.CollectionDef.Int64List int64_list = 3;- Specified by:
getInt64ListOrBuilderin interfaceCollectionDefOrBuilder
-
hasFloatList
public boolean hasFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4;- Specified by:
hasFloatListin interfaceCollectionDefOrBuilder- Returns:
- Whether the floatList field is set.
-
getFloatList
public CollectionDef.FloatList getFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4;- Specified by:
getFloatListin interfaceCollectionDefOrBuilder- Returns:
- The floatList.
-
getFloatListOrBuilder
public CollectionDef.FloatListOrBuilder getFloatListOrBuilder()
.tensorflow.CollectionDef.FloatList float_list = 4;- Specified by:
getFloatListOrBuilderin interfaceCollectionDefOrBuilder
-
hasAnyList
public boolean hasAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5;- Specified by:
hasAnyListin interfaceCollectionDefOrBuilder- Returns:
- Whether the anyList field is set.
-
getAnyList
public CollectionDef.AnyList getAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5;- Specified by:
getAnyListin interfaceCollectionDefOrBuilder- Returns:
- The anyList.
-
getAnyListOrBuilder
public CollectionDef.AnyListOrBuilder getAnyListOrBuilder()
.tensorflow.CollectionDef.AnyList any_list = 5;- Specified by:
getAnyListOrBuilderin interfaceCollectionDefOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfaceorg.nd4j.shade.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(org.nd4j.shade.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
writeToin classorg.nd4j.shade.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
getSerializedSizein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceorg.nd4j.shade.protobuf.Message- Overrides:
equalsin classorg.nd4j.shade.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceorg.nd4j.shade.protobuf.Message- Overrides:
hashCodein classorg.nd4j.shade.protobuf.AbstractMessage
-
parseFrom
public static CollectionDef parseFrom(ByteBuffer data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(ByteBuffer data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(org.nd4j.shade.protobuf.ByteString data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(org.nd4j.shade.protobuf.ByteString data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(byte[] data) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(byte[] data, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
- Throws:
org.nd4j.shade.protobuf.InvalidProtocolBufferException
-
parseFrom
public static CollectionDef parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static CollectionDef parseFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static CollectionDef parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static CollectionDef parseDelimitedFrom(InputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static CollectionDef parseFrom(org.nd4j.shade.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static CollectionDef parseFrom(org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public CollectionDef.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfaceorg.nd4j.shade.protobuf.Message- Specified by:
newBuilderForTypein interfaceorg.nd4j.shade.protobuf.MessageLite
-
newBuilder
public static CollectionDef.Builder newBuilder()
-
newBuilder
public static CollectionDef.Builder newBuilder(CollectionDef prototype)
-
toBuilder
public CollectionDef.Builder toBuilder()
- Specified by:
toBuilderin interfaceorg.nd4j.shade.protobuf.Message- Specified by:
toBuilderin interfaceorg.nd4j.shade.protobuf.MessageLite
-
newBuilderForType
protected CollectionDef.Builder newBuilderForType(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static CollectionDef getDefaultInstance()
-
parser
public static org.nd4j.shade.protobuf.Parser<CollectionDef> parser()
-
getParserForType
public org.nd4j.shade.protobuf.Parser<CollectionDef> getParserForType()
- Specified by:
getParserForTypein interfaceorg.nd4j.shade.protobuf.Message- Specified by:
getParserForTypein interfaceorg.nd4j.shade.protobuf.MessageLite- Overrides:
getParserForTypein classorg.nd4j.shade.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public CollectionDef getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfaceorg.nd4j.shade.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfaceorg.nd4j.shade.protobuf.MessageOrBuilder
-
-