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)
tensorflow.CollectionDef
Metode Publik
CollectionDef.Builder | addRepeatedField (bidang com.google.protobuf.Descriptors.FieldDescriptor, Nilai objek) |
KoleksiDef | membangun () |
KoleksiDef | |
CollectionDef.Builder | jernih () |
CollectionDef.Builder | hapus Daftar Apa Pun () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder | clearBytesList () .tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder | clearField (bidang com.google.protobuf.Descriptors.FieldDescriptor) |
CollectionDef.Builder | hapusFloatList () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder | hapusInt64List () .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder | jelasJenis () |
CollectionDef.Builder | hapusNodeList () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder | clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
CollectionDef.Builder | klon () |
CollectionDef.AnyList | dapatkan Daftar Apa Saja () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyList.Builder | dapatkanAnyListBuilder () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyListOrBuilder | dapatkanAnyListOrBuilder () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.BytesList | dapatkanBytesList () .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; |
KoleksiDef | |
com.google.protobuf.Descriptors.Descriptor statis terakhir | |
com.google.protobuf.Descriptors.Descriptor | |
CollectionDef.FloatList | dapatkanDaftarFloat () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatList.Builder | dapatkanFloatListBuilder () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatListOrBuilder | dapatkanFloatListOrBuilder () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Int64List | dapatkanInt64List () .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; |
KoleksiDef.KindCase | |
CollectionDef.NodeList | dapatkanNodeList () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeList.Builder | dapatkanNodeListBuilder () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeListOrBuilder | getNodeListOrBuilder () .tensorflow.CollectionDef.NodeList node_list = 1; |
boolean | memiliki Daftar Apa Pun () .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; |
boolean terakhir | |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder | mergeFrom (com.google.protobuf.Pesan lainnya) |
CollectionDef.Builder | mergeFrom (com.google.protobuf.CodedInputStream masukan, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder terakhir | mergeUnknownFields (com.google.protobuf.UnknownFieldSet unknownFields) |
CollectionDef.Builder | |
CollectionDef.Builder | setAnyList ( CollectionDef.AnyList.Pembuat BuilderForValue) .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder | setBytesList ( CollectionDef.BytesList.Pembuat pembangunForValue) .tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder | |
CollectionDef.Builder | setField (bidang com.google.protobuf.Descriptors.FieldDescriptor, Nilai objek) |
CollectionDef.Builder | |
CollectionDef.Builder | setFloatList ( CollectionDef.FloatList.Pembuat pembangunForValue) .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder | |
CollectionDef.Builder | setInt64List ( CollectionDef.Int64List.Pembuat pembangunForValue) .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder | setNodeList ( CollectionDef.NodeList.Pembuat pembangunForValue) .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder | |
CollectionDef.Builder | setRepeatedField (bidang com.google.protobuf.Descriptors.FieldDescriptor, indeks int, Nilai objek) |
CollectionDef.Builder terakhir | setUnknownFields (com.google.protobuf.UnknownFieldSet unknownFields) |
Metode Warisan
Metode Publik
public CollectionDef.Builder addRepeatedField (bidang com.google.protobuf.Descriptors.FieldDescriptor, Nilai objek)
publik CollectionDef.AnyList.Builder getAnyListBuilder ()
.tensorflow.CollectionDef.AnyList any_list = 5;
publik CollectionDef.AnyListOrBuilder getAnyListOrBuilder ()
.tensorflow.CollectionDef.AnyList any_list = 5;
publik CollectionDef.BytesList.Builder getBytesListBuilder ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
publik CollectionDef.BytesListOrBuilder getBytesListOrBuilder ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
com.google.protobuf.Descriptors.Descriptor publik getDescriptorForType ()
publik CollectionDef.FloatList.Builder getFloatListBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
publik CollectionDef.FloatListOrBuilder getFloatListOrBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
publik CollectionDef.Int64List.Builder getInt64ListBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
publik CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
publik CollectionDef.NodeList.Builder getNodeListBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
publik CollectionDef.NodeListOrBuilder getNodeListOrBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
boolean publik hasAnyList ()
.tensorflow.CollectionDef.AnyList any_list = 5;
hasBytesList boolean publik ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
boolean publik hasFloatList ()
.tensorflow.CollectionDef.FloatList float_list = 4;
boolean publik hasInt64List ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
boolean publik hasNodeList ()
.tensorflow.CollectionDef.NodeList node_list = 1;
boolean akhir publik diinisialisasi ()
publik CollectionDef.Builder mergeAnyList (nilai CollectionDef.AnyList )
.tensorflow.CollectionDef.AnyList any_list = 5;
publik CollectionDef.Builder mergeBytesList (nilai CollectionDef.BytesList )
.tensorflow.CollectionDef.BytesList bytes_list = 2;
publik CollectionDef.Builder mergeFloatList (nilai CollectionDef.FloatList )
.tensorflow.CollectionDef.FloatList float_list = 4;
public CollectionDef.Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Melempar
Pengecualian IO |
---|
publik CollectionDef.Builder mergeInt64List (nilai CollectionDef.Int64List )
.tensorflow.CollectionDef.Int64List int64_list = 3;
publik CollectionDef.Builder mergeNodeList (nilai CollectionDef.NodeList )
.tensorflow.CollectionDef.NodeList node_list = 1;
public final CollectionDef.Builder mergeUnknownFields (com.google.protobuf.UnknownFieldSet unknownFields)
publik CollectionDef.Builder setAnyList (nilai CollectionDef.AnyList )
.tensorflow.CollectionDef.AnyList any_list = 5;
publik CollectionDef.Builder setAnyList ( CollectionDef.AnyList.Builder builderForValue)
.tensorflow.CollectionDef.AnyList any_list = 5;
publik CollectionDef.Builder setBytesList ( CollectionDef.BytesList.Builder builderForValue)
.tensorflow.CollectionDef.BytesList bytes_list = 2;
publik CollectionDef.Builder setBytesList (nilai CollectionDef.BytesList )
.tensorflow.CollectionDef.BytesList bytes_list = 2;
public CollectionDef.Builder setField (bidang com.google.protobuf.Descriptors.FieldDescriptor, Nilai objek)
publik CollectionDef.Builder setFloatList (nilai CollectionDef.FloatList )
.tensorflow.CollectionDef.FloatList float_list = 4;
publik CollectionDef.Builder setFloatList ( CollectionDef.FloatList.Builder builderForValue)
.tensorflow.CollectionDef.FloatList float_list = 4;
publik CollectionDef.Builder setInt64List (nilai CollectionDef.Int64List )
.tensorflow.CollectionDef.Int64List int64_list = 3;
CollectionDef.Builder setInt64List publik ( CollectionDef.Int64List.Builder builderForValue)
.tensorflow.CollectionDef.Int64List int64_list = 3;
publik CollectionDef.Builder setNodeList ( CollectionDef.NodeList.Builder builderForValue)
.tensorflow.CollectionDef.NodeList node_list = 1;
publik CollectionDef.Builder setNodeList (nilai CollectionDef.NodeList )
.tensorflow.CollectionDef.NodeList node_list = 1;