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.AnyList | AnyList is used for collecting Any protos. | |
מִמְשָׁק | CollectionDef.AnyListOrBuilder | ||
מַחלָקָה | CollectionDef.Builder | CollectionDef should cover most collections. | |
מַחלָקָה | CollectionDef.BytesList | BytesList is used for collecting strings and serialized protobufs. | |
מִמְשָׁק | CollectionDef.BytesListOrBuilder | ||
מַחלָקָה | CollectionDef.FloatList | FloatList is used for collecting float values. | |
מִמְשָׁק | CollectionDef.FloatListOrBuilder | ||
מַחלָקָה | CollectionDef.Int64List | Int64List is used for collecting int, int64 and long values. | |
מִמְשָׁק | CollectionDef.Int64ListOrBuilder | ||
enum | CollectionDef.KindCase | ||
מַחלָקָה | CollectionDef.NodeList | NodeList is used for collecting nodes in graph. | |
מִמְשָׁק | CollectionDef.NodeListOrBuilder |
קבועים
int | ANY_LIST_FIELD_NUMBER | |
int | BYTES_LIST_FIELD_NUMBER | |
int | FLOAT_LIST_FIELD_NUMBER | |
int | INT64_LIST_FIELD_NUMBER | |
int | NODE_LIST_FIELD_NUMBER |
שיטות ציבוריות
בוליאני | שווה (Object obj) |
CollectionDef.AnyList | getAnyList () .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.BytesListOrBuilder | getBytesListOrBuilder () .tensorflow.CollectionDef.BytesList bytes_list = 2; |
סטטי CollectionDef | |
CollectionDef | |
final static com.google.protobuf.Descriptors.Descriptor | |
CollectionDef.FloatList | getFloatList () .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.Int64ListOrBuilder | getInt64ListOrBuilder () .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.KindCase | getKindCase () |
CollectionDef.NodeList | getNodeList () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.NodeListOrBuilder | getNodeListOrBuilder () .tensorflow.CollectionDef.NodeList node_list = 1; |
int | |
final com.google.protobuf.UnknownFieldSet | |
בוליאני | 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; |
int | hashcode () |
בוליאנית סופית | |
סטטי CollectionDef.Builder | newBuilder (אב-טיפוס CollectionDef ) |
סטטי CollectionDef.Builder | newBuilder () |
CollectionDef.Builder | |
סטטי CollectionDef | parseDelimitedFrom (קלט InputStream) |
סטטי CollectionDef | parseDelimitedFrom (קלט InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטטי CollectionDef | parseFrom (נתוני ByteBuffer) |
סטטי CollectionDef | parseFrom (קלט com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטטי CollectionDef | parseFrom (נתוני ByteBuffer, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטטי CollectionDef | parseFrom (קלט com.google.protobuf.CodedInputStream) |
סטטי CollectionDef | parseFrom (נתוני byte[], com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטטי CollectionDef | parseFrom (נתוני com.google.protobuf.ByteString) |
סטטי CollectionDef | parseFrom (קלט InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטטי CollectionDef | parseFrom (נתוני com.google.protobuf.ByteString, com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
סטָטִי | מנתח () |
CollectionDef.Builder | toBuilder () |
בָּטֵל | writeTo (פלט com.google.protobuf.CodedOutputStream) |
שיטות בירושה
קבועים
גמר סטטי ציבורי ב- ANY_LIST_FIELD_NUMBER
אינט סופי סטטי ציבורי BYTES_LIST_FIELD_NUMBER
גמר סטטי ציבורי FLOAT_LIST_FIELD_NUMBER
אינט גמר סטטי ציבורי INT64_LIST_FIELD_NUMBER
גמר סטטי ציבורי NODE_LIST_FIELD_NUMBER
שיטות ציבוריות
שווה ערך בוליאני ציבורי (Object obj)
Public CollectionDef.AnyListOrBuilder getAnyListOrBuilder ()
.tensorflow.CollectionDef.AnyList any_list = 5;
Public CollectionDef.BytesListOrBuilder getBytesListOrBuilder ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
Public CollectionDef.FloatListOrBuilder getFloatListOrBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
Public CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
Public CollectionDef.NodeListOrBuilder getNodeListOrBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
פּוּמְבֵּי getParserForType ()
public int getSerializedSize ()
public final com.google.protobuf.UnknownFieldSet getUnknownFields ()
יש AnyList בוליאני ציבורי ()
.tensorflow.CollectionDef.AnyList any_list = 5;
hasBytesList בוליאני ציבורי ()
.tensorflow.CollectionDef.BytesList bytes_list = 2;
ישFloatList בוליאני ציבורי ()
.tensorflow.CollectionDef.FloatList float_list = 4;
hasInt64List בוליאני ציבורי ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
hasNodeList בוליאני ציבורי ()
.tensorflow.CollectionDef.NodeList node_list = 1;
public int hashCode ()
בוליאני הסופי הציבורי הוא אתחול ()
public static CollectionDef parseDelimitedFrom (קלט InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
IOException |
---|
Public static CollectionDef parseFrom (קלט com.google.protobuf.CodedInputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
IOException |
---|
Public static CollectionDef parseFrom (נתוני ByteBuffer, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
InvalidProtocolBufferException |
---|
public static CollectionDef parseFrom (נתוני byte[], com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
InvalidProtocolBufferException |
---|
Public static CollectionDef parseFrom (נתוני com.google.protobuf.ByteString)
זורק
InvalidProtocolBufferException |
---|
Public static CollectionDef parseFrom (קלט InputStream, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
IOException |
---|
Public static CollectionDef parseFrom (נתוני com.google.protobuf.ByteString, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
זורק
InvalidProtocolBufferException |
---|
סטטי ציבורי מנתח ()
public void writeTo (פלט com.google.protobuf.CodedOutputStream)
זורק
IOException |
---|