public static final class CollectionDef.Builder extends org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder> 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 type tensorflow.CollectionDef| Modifier and Type | Method and Description |
|---|---|
CollectionDef.Builder |
addRepeatedField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
Object value) |
CollectionDef |
build() |
CollectionDef |
buildPartial() |
CollectionDef.Builder |
clear() |
CollectionDef.Builder |
clearAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder |
clearBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder |
clearField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field) |
CollectionDef.Builder |
clearFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder |
clearInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder |
clearKind() |
CollectionDef.Builder |
clearNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder |
clearOneof(org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof) |
CollectionDef.Builder |
clone() |
CollectionDef.AnyList |
getAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyList.Builder |
getAnyListBuilder()
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyListOrBuilder |
getAnyListOrBuilder()
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.BytesList |
getBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.BytesList.Builder |
getBytesListBuilder()
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.BytesListOrBuilder |
getBytesListOrBuilder()
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef |
getDefaultInstanceForType() |
static org.nd4j.shade.protobuf.Descriptors.Descriptor |
getDescriptor() |
org.nd4j.shade.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
CollectionDef.FloatList |
getFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatList.Builder |
getFloatListBuilder()
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatListOrBuilder |
getFloatListOrBuilder()
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Int64List |
getInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Int64List.Builder |
getInt64ListBuilder()
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Int64ListOrBuilder |
getInt64ListOrBuilder()
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.KindCase |
getKindCase() |
CollectionDef.NodeList |
getNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeList.Builder |
getNodeListBuilder()
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeListOrBuilder |
getNodeListOrBuilder()
.tensorflow.CollectionDef.NodeList node_list = 1; |
boolean |
hasAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5; |
boolean |
hasBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
boolean |
hasFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4; |
boolean |
hasInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3; |
boolean |
hasNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1; |
protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
CollectionDef.Builder |
mergeAnyList(CollectionDef.AnyList value)
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder |
mergeBytesList(CollectionDef.BytesList value)
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder |
mergeFloatList(CollectionDef.FloatList value)
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder |
mergeFrom(org.nd4j.shade.protobuf.CodedInputStream input,
org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) |
CollectionDef.Builder |
mergeFrom(CollectionDef other) |
CollectionDef.Builder |
mergeFrom(org.nd4j.shade.protobuf.Message other) |
CollectionDef.Builder |
mergeInt64List(CollectionDef.Int64List value)
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder |
mergeNodeList(CollectionDef.NodeList value)
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder |
mergeUnknownFields(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields) |
CollectionDef.Builder |
setAnyList(CollectionDef.AnyList.Builder builderForValue)
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder |
setAnyList(CollectionDef.AnyList value)
.tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder |
setBytesList(CollectionDef.BytesList.Builder builderForValue)
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder |
setBytesList(CollectionDef.BytesList value)
.tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder |
setField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
Object value) |
CollectionDef.Builder |
setFloatList(CollectionDef.FloatList.Builder builderForValue)
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder |
setFloatList(CollectionDef.FloatList value)
.tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder |
setInt64List(CollectionDef.Int64List.Builder builderForValue)
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder |
setInt64List(CollectionDef.Int64List value)
.tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder |
setNodeList(CollectionDef.NodeList.Builder builderForValue)
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder |
setNodeList(CollectionDef.NodeList value)
.tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder |
setRepeatedField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
CollectionDef.Builder |
setUnknownFields(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder clear()
clear in interface org.nd4j.shade.protobuf.Message.Builderclear in interface org.nd4j.shade.protobuf.MessageLite.Builderclear in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface org.nd4j.shade.protobuf.Message.BuildergetDescriptorForType in interface org.nd4j.shade.protobuf.MessageOrBuildergetDescriptorForType in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef getDefaultInstanceForType()
getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilderpublic CollectionDef build()
build in interface org.nd4j.shade.protobuf.Message.Builderbuild in interface org.nd4j.shade.protobuf.MessageLite.Builderpublic CollectionDef buildPartial()
buildPartial in interface org.nd4j.shade.protobuf.Message.BuilderbuildPartial in interface org.nd4j.shade.protobuf.MessageLite.Builderpublic CollectionDef.Builder clone()
clone in interface org.nd4j.shade.protobuf.Message.Builderclone in interface org.nd4j.shade.protobuf.MessageLite.Builderclone in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder setField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, Object value)
setField in interface org.nd4j.shade.protobuf.Message.BuildersetField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder clearField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field)
clearField in interface org.nd4j.shade.protobuf.Message.BuilderclearField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder clearOneof(org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface org.nd4j.shade.protobuf.Message.BuilderclearOneof in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder setRepeatedField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField in interface org.nd4j.shade.protobuf.Message.BuildersetRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder addRepeatedField(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField in interface org.nd4j.shade.protobuf.Message.BuilderaddRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder mergeFrom(org.nd4j.shade.protobuf.Message other)
mergeFrom in interface org.nd4j.shade.protobuf.Message.BuildermergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<CollectionDef.Builder>public CollectionDef.Builder mergeFrom(CollectionDef other)
public final boolean isInitialized()
isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilderisInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public CollectionDef.Builder mergeFrom(org.nd4j.shade.protobuf.CodedInputStream input, org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface org.nd4j.shade.protobuf.Message.BuildermergeFrom in interface org.nd4j.shade.protobuf.MessageLite.BuildermergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<CollectionDef.Builder>IOExceptionpublic CollectionDef.KindCase getKindCase()
getKindCase in interface CollectionDefOrBuilderpublic CollectionDef.Builder clearKind()
public boolean hasNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1;hasNodeList in interface CollectionDefOrBuilderpublic CollectionDef.NodeList getNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1;getNodeList in interface CollectionDefOrBuilderpublic CollectionDef.Builder setNodeList(CollectionDef.NodeList value)
.tensorflow.CollectionDef.NodeList node_list = 1;public CollectionDef.Builder setNodeList(CollectionDef.NodeList.Builder builderForValue)
.tensorflow.CollectionDef.NodeList node_list = 1;public CollectionDef.Builder mergeNodeList(CollectionDef.NodeList value)
.tensorflow.CollectionDef.NodeList node_list = 1;public CollectionDef.Builder clearNodeList()
.tensorflow.CollectionDef.NodeList node_list = 1;public CollectionDef.NodeList.Builder getNodeListBuilder()
.tensorflow.CollectionDef.NodeList node_list = 1;public CollectionDef.NodeListOrBuilder getNodeListOrBuilder()
.tensorflow.CollectionDef.NodeList node_list = 1;getNodeListOrBuilder in interface CollectionDefOrBuilderpublic boolean hasBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2;hasBytesList in interface CollectionDefOrBuilderpublic CollectionDef.BytesList getBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2;getBytesList in interface CollectionDefOrBuilderpublic CollectionDef.Builder setBytesList(CollectionDef.BytesList value)
.tensorflow.CollectionDef.BytesList bytes_list = 2;public CollectionDef.Builder setBytesList(CollectionDef.BytesList.Builder builderForValue)
.tensorflow.CollectionDef.BytesList bytes_list = 2;public CollectionDef.Builder mergeBytesList(CollectionDef.BytesList value)
.tensorflow.CollectionDef.BytesList bytes_list = 2;public CollectionDef.Builder clearBytesList()
.tensorflow.CollectionDef.BytesList bytes_list = 2;public CollectionDef.BytesList.Builder getBytesListBuilder()
.tensorflow.CollectionDef.BytesList bytes_list = 2;public CollectionDef.BytesListOrBuilder getBytesListOrBuilder()
.tensorflow.CollectionDef.BytesList bytes_list = 2;getBytesListOrBuilder in interface CollectionDefOrBuilderpublic boolean hasInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3;hasInt64List in interface CollectionDefOrBuilderpublic CollectionDef.Int64List getInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3;getInt64List in interface CollectionDefOrBuilderpublic CollectionDef.Builder setInt64List(CollectionDef.Int64List value)
.tensorflow.CollectionDef.Int64List int64_list = 3;public CollectionDef.Builder setInt64List(CollectionDef.Int64List.Builder builderForValue)
.tensorflow.CollectionDef.Int64List int64_list = 3;public CollectionDef.Builder mergeInt64List(CollectionDef.Int64List value)
.tensorflow.CollectionDef.Int64List int64_list = 3;public CollectionDef.Builder clearInt64List()
.tensorflow.CollectionDef.Int64List int64_list = 3;public CollectionDef.Int64List.Builder getInt64ListBuilder()
.tensorflow.CollectionDef.Int64List int64_list = 3;public CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder()
.tensorflow.CollectionDef.Int64List int64_list = 3;getInt64ListOrBuilder in interface CollectionDefOrBuilderpublic boolean hasFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4;hasFloatList in interface CollectionDefOrBuilderpublic CollectionDef.FloatList getFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4;getFloatList in interface CollectionDefOrBuilderpublic CollectionDef.Builder setFloatList(CollectionDef.FloatList value)
.tensorflow.CollectionDef.FloatList float_list = 4;public CollectionDef.Builder setFloatList(CollectionDef.FloatList.Builder builderForValue)
.tensorflow.CollectionDef.FloatList float_list = 4;public CollectionDef.Builder mergeFloatList(CollectionDef.FloatList value)
.tensorflow.CollectionDef.FloatList float_list = 4;public CollectionDef.Builder clearFloatList()
.tensorflow.CollectionDef.FloatList float_list = 4;public CollectionDef.FloatList.Builder getFloatListBuilder()
.tensorflow.CollectionDef.FloatList float_list = 4;public CollectionDef.FloatListOrBuilder getFloatListOrBuilder()
.tensorflow.CollectionDef.FloatList float_list = 4;getFloatListOrBuilder in interface CollectionDefOrBuilderpublic boolean hasAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5;hasAnyList in interface CollectionDefOrBuilderpublic CollectionDef.AnyList getAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5;getAnyList in interface CollectionDefOrBuilderpublic CollectionDef.Builder setAnyList(CollectionDef.AnyList value)
.tensorflow.CollectionDef.AnyList any_list = 5;public CollectionDef.Builder setAnyList(CollectionDef.AnyList.Builder builderForValue)
.tensorflow.CollectionDef.AnyList any_list = 5;public CollectionDef.Builder mergeAnyList(CollectionDef.AnyList value)
.tensorflow.CollectionDef.AnyList any_list = 5;public CollectionDef.Builder clearAnyList()
.tensorflow.CollectionDef.AnyList any_list = 5;public CollectionDef.AnyList.Builder getAnyListBuilder()
.tensorflow.CollectionDef.AnyList any_list = 5;public CollectionDef.AnyListOrBuilder getAnyListOrBuilder()
.tensorflow.CollectionDef.AnyList any_list = 5;getAnyListOrBuilder in interface CollectionDefOrBuilderpublic final CollectionDef.Builder setUnknownFields(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface org.nd4j.shade.protobuf.Message.BuildersetUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>public final CollectionDef.Builder mergeUnknownFields(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface org.nd4j.shade.protobuf.Message.BuildermergeUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<CollectionDef.Builder>Copyright © 2021. All rights reserved.