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
الأساليب العامة
CollectionDef.Builder | addRepeatedField (حقل com.google.protobuf.Descriptors.FieldDescriptor، قيمة الكائن) |
CollectionDef | يبني () |
CollectionDef | بناء جزئي () |
CollectionDef.Builder | واضح () |
CollectionDef.Builder | كلير أني ليست () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder | قائمة كلير بايتس () .tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder | ClearField (حقل com.google.protobuf.Descriptors.FieldDescriptor) |
CollectionDef.Builder | قائمة واضحة () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder | قائمة ClearInt64 () .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder | كلير كيند () |
CollectionDef.Builder | قائمة ClearNode () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder | ClearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
CollectionDef.Builder | استنساخ () |
CollectionDef.AnyList | الحصول على أي قائمة () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyList.Builder | الحصول على AnyListBuilder () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.AnyListOrBuilder | الحصول علىAnyListOrBuilder () .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.BytesList | قائمة getBytes () .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 | |
النهائي الثابت com.google.protobuf.Descriptors.Descriptor | |
com.google.protobuf.Descriptors.Descriptor | |
CollectionDef.FloatList | قائمة العائمة () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatList.Builder | الحصول على FloatListBuilder () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.FloatListOrBuilder | getFloatListOrBuilder () .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Int64List | قائمة getInt64 () .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 | جيتكيند كيس () |
CollectionDef.NodeList | قائمة العقدة () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeList.Builder | الحصول على NodeListBuilder () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeListOrBuilder | getNodeListOrBuilder () .tensorflow.CollectionDef.NodeList node_list = 1; |
منطقية | لديهAnyList () .tensorflow.CollectionDef.AnyList any_list = 5; |
منطقية | قائمة بايت () .tensorflow.CollectionDef.BytesList bytes_list = 2; |
منطقية | قائمة عائمة () .tensorflow.CollectionDef.FloatList float_list = 4; |
منطقية | hasInt64List () .tensorflow.CollectionDef.Int64List int64_list = 3; |
منطقية | قائمة العقدة () .tensorflow.CollectionDef.NodeList node_list = 1; |
منطقية نهائية | تمت التهيئة () |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder | دمج من (com.google.protobuf.Message أخرى) |
CollectionDef.Builder | دمج من (com.google.protobuf.CodedInputStream input، com.google.protobuf.ExtensionRegistryLite ExtensionRegistry) |
CollectionDef.Builder | |
CollectionDef.Builder | |
Final CollectionDef.Builder | دمجUnknownFields (com.google.protobuf.UnknownFieldSet UnknownFields) |
CollectionDef.Builder | |
CollectionDef.Builder | setAnyList ( CollectionDef.AnyList.Builder builderForValue) .tensorflow.CollectionDef.AnyList any_list = 5; |
CollectionDef.Builder | setBytesList ( CollectionDef.BytesList.Builder builderForValue) .tensorflow.CollectionDef.BytesList bytes_list = 2; |
CollectionDef.Builder | |
CollectionDef.Builder | setField (حقل com.google.protobuf.Descriptors.FieldDescriptor، قيمة الكائن) |
CollectionDef.Builder | |
CollectionDef.Builder | setFloatList ( CollectionDef.FloatList.Builder builderForValue) .tensorflow.CollectionDef.FloatList float_list = 4; |
CollectionDef.Builder | |
CollectionDef.Builder | setInt64List ( CollectionDef.Int64List.Builder builderForValue) .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder | setNodeList ( CollectionDef.NodeList.Builder builderForValue) .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder | |
CollectionDef.Builder | setRepeatedField (حقل com.google.protobuf.Descriptors.FieldDescriptor، مؤشر int، قيمة الكائن) |
Final CollectionDef.Builder | setUnknownFields (com.google.protobuf.UnknownFieldSet UnknownFields) |
الطرق الموروثة
الأساليب العامة
public CollectionDef.Builder addRepeatedField (حقل com.google.protobuf.Descriptors.FieldDescriptor، قيمة الكائن)
العامة CollectionDef.AnyList.Builder getAnyListBuilder ()
.tensorflow.CollectionDef.AnyList any_list = 5;
CollectionDef.AnyListOrBuilder العامة getAnyListOrBuilder ()
.tensorflow.CollectionDef.AnyList any_list = 5;
CollectionDef.BytesList.Builder العامة getBytesListBuilder ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
مجموعة عامة Def.BytesListOrBuilder getBytesListOrBuilder ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
النهائي العام الثابت com.google.protobuf.Descriptors.Descriptor getDescriptor ()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType () العام
العامة CollectionDef.FloatList.Builder getFloatListBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
public CollectionDef.FloatListOrBuilder getFloatListOrBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
المجموعة العامةDef.Int64List.Builder getInt64ListBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
مجموعة عامة Def.Int64ListOrBuilder getInt64ListOrBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
CollectionDef.NodeList.Builder العامة getNodeListBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
public CollectionDef.NodeListOrBuilder getNodeListOrBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
المنطق المنطقي العام hasAnyList ()
.tensorflow.CollectionDef.AnyList any_list = 5;
hasBytesList () المنطقية العامة
.tensorflow.CollectionDef.BytesList bytes_list = 2;
المنطقية العامة hasFloatList ()
.tensorflow.CollectionDef.FloatList float_list = 4;
hasInt64List () المنطقية العامة
.tensorflow.CollectionDef.Int64List int64_list = 3;
hasNodeList () المنطقية العامة
.tensorflow.CollectionDef.NodeList node_list = 1;
تمت تهيئة القيمة المنطقية النهائية العامة ()
العامة CollectionDef.Builder mergeAnyList (قيمة CollectionDef.AnyList )
.tensorflow.CollectionDef.AnyList any_list = 5;
العامة CollectionDef.Builder mergeBytesList (قيمة CollectionDef.BytesList )
.tensorflow.CollectionDef.BytesList bytes_list = 2;
العامة CollectionDef.Builder mergeFloatList (قيمة CollectionDef.FloatList )
.tensorflow.CollectionDef.FloatList float_list = 4;
العامة CollectionDef.Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite ExtensionRegistry)
رميات
IOEException |
---|
العامة CollectionDef.Builder mergeInt64List (قيمة CollectionDef.Int64List )
.tensorflow.CollectionDef.Int64List int64_list = 3;
العامة CollectionDef.Builder mergeNodeList (قيمة CollectionDef.NodeList )
.tensorflow.CollectionDef.NodeList node_list = 1;
النهائي العام CollectionDef.Builder mergeUnknownFields (com.google.protobuf.UnknownFieldSetUnknownFields)
مجموعة CollectionDef.Builder العامة AnyList (قيمة CollectionDef.AnyList )
.tensorflow.CollectionDef.AnyList any_list = 5;
مجموعة CollectionDef.Builder العامة AnyList ( CollectionDef.AnyList.Builder builderForValue)
.tensorflow.CollectionDef.AnyList any_list = 5;
مجموعة CollectionDef.Builder العامة setBytesList ( CollectionDef.BytesList.Builder builderForValue)
.tensorflow.CollectionDef.BytesList bytes_list = 2;
مجموعة CollectionDef.Builder العامة setBytesList (قيمة CollectionDef.BytesList )
.tensorflow.CollectionDef.BytesList bytes_list = 2;
مجموعة CollectionDef.Builder العامة setField (حقل com.google.protobuf.Descriptors.FieldDescriptor، قيمة الكائن)
مجموعة CollectionDef.Builder العامة setFloatList (قيمة CollectionDef.FloatList )
.tensorflow.CollectionDef.FloatList float_list = 4;
مجموعة CollectionDef.Builder العامة setFloatList ( CollectionDef.FloatList.Builder builderForValue)
.tensorflow.CollectionDef.FloatList float_list = 4;
مجموعة CollectionDef.Builder العامة setInt64List (قيمة CollectionDef.Int64List )
.tensorflow.CollectionDef.Int64List int64_list = 3;
مجموعة CollectionDef.Builder العامة Int64List ( CollectionDef.Int64List.Builder builderForValue)
.tensorflow.CollectionDef.Int64List int64_list = 3;
مجموعة CollectionDef.Builder العامة NodeList ( CollectionDef.NodeList.Builder builderForValue)
.tensorflow.CollectionDef.NodeList node_list = 1;
مجموعة CollectionDef.Builder العامة setNodeList (قيمة CollectionDef.NodeList )
.tensorflow.CollectionDef.NodeList node_list = 1;