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 필드, 개체 값) |
컬렉션Def | 짓다 () |
컬렉션Def | 빌드부분 () |
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 | 클리어Int64List () .tensorflow.CollectionDef.Int64List int64_list = 3; |
CollectionDef.Builder | 클리어카인드 () |
CollectionDef.Builder | 클리어노드리스트 () .tensorflow.CollectionDef.NodeList node_list = 1; |
CollectionDef.Builder | ClearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
CollectionDef.Builder | 클론 () |
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; |
컬렉션Def | |
최종 정적 com.google.protobuf.Descriptors.Descriptor | |
com.google.protobuf.Descriptors.Descriptor | |
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; |
부울 | hasAnyList () .tensorflow.CollectionDef.AnyList any_list = 5; |
부울 | 해시바이트목록 () .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 | |
CollectionDef.Builder | |
CollectionDef.Builder | |
CollectionDef.Builder | mergeFrom (com.google.protobuf.다른 메시지 보내기) |
CollectionDef.Builder | mergeFrom (com.google.protobuf.CodedInputStream 입력, com.google.protobuf.ExtensionRegistryLite ExtensionRegistry) |
CollectionDef.Builder | |
CollectionDef.Builder | |
최종 CollectionDef.Builder | mergeUnknownFields (com.google.protobuf.UnknownFieldSet 알려지지 않은Fields) |
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 인덱스, 개체 값) |
최종 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;
공개 CollectionDef.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;
공개 CollectionDef.FloatListOrBuilder getFloatListOrBuilder ()
.tensorflow.CollectionDef.FloatList float_list = 4;
공개 CollectionDef.Int64List.Builder getInt64ListBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
공개 CollectionDef.Int64ListOrBuilder getInt64ListOrBuilder ()
.tensorflow.CollectionDef.Int64List int64_list = 3;
공개 CollectionDef.NodeList.Builder getNodeListBuilder ()
.tensorflow.CollectionDef.NodeList node_list = 1;
공개 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;
공개 최종 부울 isInitialized ()
공개 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 입력, com.google.protobuf.ExtensionRegistryLite 확장Registry)
던지기
IO예외 |
---|
공개 CollectionDef.Builder mergeInt64List ( CollectionDef.Int64List 값)
.tensorflow.CollectionDef.Int64List int64_list = 3;
공용 CollectionDef.Builder mergeNodeList ( CollectionDef.NodeList 값)
.tensorflow.CollectionDef.NodeList node_list = 1;
공개 CollectionDef.Builder setAnyList ( CollectionDef.AnyList 값)
.tensorflow.CollectionDef.AnyList any_list = 5;
공개 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 setBytesList ( CollectionDef.BytesList 값)
.tensorflow.CollectionDef.BytesList bytes_list = 2;
공개 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 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 setNodeList ( CollectionDef.NodeList 값)
.tensorflow.CollectionDef.NodeList node_list = 1;