Skip to content

Commit 7e231d5

Browse files
committed
upgrade to 1.4
1 parent df270c7 commit 7e231d5

26 files changed

Lines changed: 582 additions & 115 deletions

pom.xml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.yesup.oss</groupId>
55
<artifactId>tensorflow-client</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.5.1-1</version>
7+
<version>1.4-1</version>
88
<name>tensorflow-client</name>
99
<description>Prebuilt tensorflow serving client</description>
1010
<licenses>
@@ -14,7 +14,7 @@
1414
<distribution>repo</distribution>
1515
</license>
1616
</licenses>
17-
<url>http://www.yesupmedia.com</url>
17+
<url>http://arteebee.com/</url>
1818
<developers>
1919
<developer>
2020
<id>jeffye</id>
@@ -45,25 +45,20 @@
4545
<artifactId>slf4j-log4j12</artifactId>
4646
<version>1.7.21</version>
4747
</dependency>
48-
<dependency>
49-
<groupId>io.grpc</groupId>
50-
<artifactId>grpc-netty</artifactId>
51-
<version>1.2.0</version>
52-
</dependency>
5348
<dependency>
5449
<groupId>io.grpc</groupId>
5550
<artifactId>grpc-protobuf</artifactId>
56-
<version>1.2.0</version>
51+
<version>1.6.1</version>
5752
</dependency>
5853
<dependency>
5954
<groupId>io.grpc</groupId>
6055
<artifactId>grpc-stub</artifactId>
61-
<version>1.2.0</version>
56+
<version>1.6.1</version>
6257
</dependency>
6358
<dependency>
6459
<groupId>junit</groupId>
6560
<artifactId>junit</artifactId>
66-
<version>3.8.1</version>
61+
<version>4.12</version>
6762
<scope>test</scope>
6863
</dependency>
6964
</dependencies>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Defines the text format for including per-op API definition and
2+
// overrides for client language op code generators.
3+
4+
syntax = "proto3";
5+
6+
package tensorflow;
7+
option cc_enable_arenas = true;
8+
option java_outer_classname = "ApiDefProtos";
9+
option java_multiple_files = true;
10+
option java_package = "org.tensorflow.framework";
11+
import "tensorflow/core/framework/attr_value.proto";
12+
13+
// Used to specify and override the default API & behavior in the
14+
// generated code for client languages, from what you would get from
15+
// the OpDef alone. There will be a set of ApiDefs that are common
16+
// to all client languages, and another set per client language.
17+
// The per-client-language ApiDefs will inherit values from the
18+
// common ApiDefs which it can either replace or modify.
19+
//
20+
// We separate the API definition from the OpDef so we can evolve the
21+
// API while remaining backwards compatible when interpretting old
22+
// graphs. Overrides go in an "api_def.pbtxt" file with a text-format
23+
// ApiDefs message.
24+
//
25+
// WARNING: Be *very* careful changing the API for any existing op --
26+
// you can change the semantics of existing code. These changes may
27+
// need to wait until a major release of TensorFlow to avoid breaking
28+
// our compatibility promises.
29+
message ApiDef {
30+
// Name of the op (in the OpDef) to specify the API for.
31+
string graph_op_name = 1;
32+
33+
enum Visibility {
34+
// Normally this is "VISIBLE" unless you are inheriting a
35+
// different value from another ApiDef.
36+
DEFAULT_VISIBILITY = 0;
37+
// Publicly visible in the API.
38+
VISIBLE = 1;
39+
// Do not include this op in the generated API. If visibility is
40+
// set to 'SKIP', other fields are ignored for this op.
41+
SKIP = 2;
42+
// Hide this op by putting it into an internal namespace (or whatever
43+
// is appropriate in the target language).
44+
HIDDEN = 3;
45+
}
46+
Visibility visibility = 2;
47+
48+
// If you specify any endpoint, this will replace all of the
49+
// inherited endpoints. The first endpoint should be the
50+
// "canonical" endpoint, and should not be deprecated (unless all
51+
// endpoints are deprecated).
52+
message Endpoint {
53+
// Name should be either like "CamelCaseName" or
54+
// "Package.CamelCaseName".
55+
string name = 1;
56+
57+
// First GraphDef version at which the op is disallowed.
58+
int32 deprecation_version = 2;
59+
}
60+
repeated Endpoint endpoint = 3;
61+
62+
message Arg {
63+
string name = 1;
64+
65+
// Change the name used to access this arg in the API from what
66+
// is used in the GraphDef. Note that these names in `backticks`
67+
// will also be replaced in the summary & description fields.
68+
string rename_to = 2;
69+
70+
// Note: this will replace any inherited arg doc. There is no
71+
// current way of modifying arg descriptions (other than replacing
72+
// them entirely) as can be done with op descriptions.
73+
string description = 3;
74+
}
75+
repeated Arg in_arg = 4;
76+
repeated Arg out_arg = 5;
77+
// List of post-rename in_arg names to specify new argument order.
78+
// Length of arg_order should be either empty to keep current order
79+
// or match size of in_arg.
80+
repeated string arg_order = 11;
81+
82+
// Description of the graph-construction-time configuration of this
83+
// Op. That is to say, this describes the attr fields that will
84+
// be specified in the NodeDef.
85+
message Attr {
86+
string name = 1;
87+
88+
// Change the name used to access this attr in the API from what
89+
// is used in the GraphDef. Note that these names in `backticks`
90+
// will also be replaced in the summary & description fields.
91+
string rename_to = 2;
92+
93+
// Specify a new default value to use for this attr. This default
94+
// will be used when creating new graphs, as opposed to the
95+
// default in the OpDef, which will be used when interpreting old
96+
// GraphDefs.
97+
AttrValue default_value = 3;
98+
99+
// Note: this will replace any inherited attr doc, there is no current
100+
// way of modifying attr descriptions as can be done with op descriptions.
101+
string description = 4;
102+
}
103+
repeated Attr attr = 6;
104+
105+
// One-line human-readable description of what the Op does.
106+
string summary = 7;
107+
108+
// Additional, longer human-readable description of what the Op does.
109+
string description = 8;
110+
111+
// Modify an existing/inherited description by adding text to the beginning
112+
// or end.
113+
string description_prefix = 9;
114+
string description_suffix = 10;
115+
}
116+
117+
message ApiDefs {
118+
repeated ApiDef op = 1;
119+
}

src/main/proto/tensorflow/core/framework/node_def.proto

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,17 @@ message NodeDef {
2929
// node should be placed.
3030
// The expected syntax for this string is as follows:
3131
//
32-
// DEVICE_SPEC ::= COLOCATED_NODE | PARTIAL_SPEC
32+
// DEVICE_SPEC ::= PARTIAL_SPEC
3333
//
34-
// COLOCATED_NODE ::= "@" NODE_NAME // See NodeDef.name above.
3534
// PARTIAL_SPEC ::= ("/" CONSTRAINT) *
3635
// CONSTRAINT ::= ("job:" JOB_NAME)
3736
// | ("replica:" [1-9][0-9]*)
3837
// | ("task:" [1-9][0-9]*)
3938
// | ( ("gpu" | "cpu") ":" ([1-9][0-9]* | "*") )
4039
//
4140
// Valid values for this string include:
42-
// * "@other/node" (colocate with "other/node")
43-
// * "/job:worker/replica:0/task:1/gpu:3" (full specification)
44-
// * "/job:worker/gpu:3" (partial specification)
41+
// * "/job:worker/replica:0/task:1/device:GPU:3" (full specification)
42+
// * "/job:worker/device:GPU:3" (partial specification)
4543
// * "" (no specification)
4644
//
4745
// If the constraints do not resolve to a single device (or if this

src/main/proto/tensorflow/core/framework/op_def.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import "tensorflow/core/framework/types.proto";
1111

1212
// Defines an operation. A NodeDef in a GraphDef specifies an Op by
1313
// using the "op" field which should match the name of a OpDef.
14+
// LINT.IfChange
1415
message OpDef {
1516
// Op names starting with an underscore are reserved for internal use.
1617
// Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*".
@@ -141,6 +142,8 @@ message OpDef {
141142
// input.
142143
bool allows_uninitialized_input = 19; // for Assign, etc.
143144
};
145+
// LINT.ThenChange(
146+
// https://www.tensorflow.org/code/tensorflow/core/framework/op_def_util.cc)
144147

145148
// Information about version-dependent deprecation of an op
146149
message OpDeprecation {

src/main/proto/tensorflow/core/framework/remote_fused_graph_execute_info.proto

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,30 @@ option java_outer_classname = "RemoteFusedGraphExecuteInfoProto";
66
option java_multiple_files = true;
77
option java_package = "org.tensorflow.framework";
88

9-
import "tensorflow/core/framework/node_def.proto";
9+
import "tensorflow/core/framework/graph.proto";
1010
import "tensorflow/core/framework/tensor_shape.proto";
1111
import "tensorflow/core/framework/types.proto";
1212

1313
// Protocol buffer representing a handle to a tensorflow resource. Handles are
1414
// not valid across executions, but can be serialized back and forth from within
1515
// a single run.
1616
message RemoteFusedGraphExecuteInfo {
17+
enum NodeType {
18+
UNUSED = 0;
19+
GRAPH_INPUT = 1;
20+
GRAPH_OUTPUT = 2;
21+
FUSED_NODE = 3;
22+
BORDER_INPUT = 4;
23+
BORDER_OUTPUT = 5;
24+
}
25+
1726
message TensorShapeTypeProto {
1827
DataType dtype = 1;
1928
TensorShapeProto shape = 2;
2029
}
2130

22-
// Nodes in remote fused graph
23-
repeated NodeDef node = 1;
31+
// Definition of remote graph
32+
GraphDef remote_graph = 1;
2433

2534
// Remote fused graph input node name
2635
repeated string graph_input_node_name = 2;

src/main/proto/tensorflow/core/framework/resource_handle.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ syntax = "proto3";
22

33
package tensorflow;
44
option cc_enable_arenas = true;
5-
option java_outer_classname = "ResourceHandleProto";
5+
option java_outer_classname = "ResourceHandle";
66
option java_multiple_files = true;
77
option java_package = "org.tensorflow.framework";
88

99
// Protocol buffer representing a handle to a tensorflow resource. Handles are
1010
// not valid across executions, but can be serialized back and forth from within
1111
// a single run.
12-
message ResourceHandle {
12+
message ResourceHandleProto {
1313
// Unique name for the device containing the resource.
1414
string device = 1;
1515

src/main/proto/tensorflow/core/framework/step_stats.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ import "tensorflow/core/framework/tensor_description.proto";
1515

1616
message AllocatorMemoryUsed {
1717
string allocator_name = 1;
18+
// These are per-node allocator memory stats.
1819
int64 total_bytes = 2;
1920
int64 peak_bytes = 3;
2021
// The bytes that are not deallocated.
2122
int64 live_bytes = 4;
23+
24+
// These are snapshots of the overall allocator memory stats.
25+
// The number of live bytes currently allocated by the allocator.
26+
int64 allocator_bytes_in_use = 5;
2227
}
2328

2429
// Output sizes recorded for a single execution of a graph node.

src/main/proto/tensorflow/core/framework/summary.proto

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@ message HistogramProto {
3333
repeated double bucket = 7 [packed = true];
3434
};
3535

36+
// A SummaryMetadata encapsulates information on which plugins are able to make
37+
// use of a certain summary value.
38+
message SummaryMetadata {
39+
message PluginData {
40+
// The name of the plugin this data pertains to.
41+
string plugin_name = 1;
42+
43+
// The content to store for the plugin. The best practice is for this to be
44+
// a binary serialized protocol buffer.
45+
bytes content = 2;
46+
}
47+
48+
// Data that associates a summary with a certain plugin.
49+
PluginData plugin_data = 1;
50+
51+
// Display name for viewing in TensorBoard.
52+
string display_name = 2;
53+
54+
// Longform readable description of the summary sequence. Markdown supported.
55+
string summary_description = 3;
56+
};
57+
3658
// A Summary is a set of named values to be displayed by the
3759
// visualizer.
3860
//
@@ -71,22 +93,21 @@ message Summary {
7193
}
7294

7395
message Value {
74-
// Name of the node that output this summary; in general, the name of a
75-
// TensorSummary node. If the node in question has multiple outputs, then
76-
// a ":\d+" suffix will be appended, like "some_op:13".
77-
// Might not be set for legacy summaries (i.e. those not using the tensor
78-
// value field)
96+
// This field is deprecated and will not be set.
7997
string node_name = 7;
8098

81-
// Tag name for the data. Will only be used by legacy summaries
82-
// (ie. those not using the tensor value field)
83-
// For legacy summaries, will be used as the title of the graph
84-
// in the visualizer.
85-
//
86-
// Tag is usually "op_name:value_name", where "op_name" itself can have
87-
// structure to indicate grouping.
99+
// Tag name for the data. Used by TensorBoard plugins to organize data. Tags
100+
// are often organized by scope (which contains slashes to convey
101+
// hierarchy). For example: foo/bar/0
88102
string tag = 1;
89103

104+
// Contains metadata on the summary value such as which plugins may use it.
105+
// Take note that many summary values may lack a metadata field. This is
106+
// because the FileWriter only keeps a metadata object on the first summary
107+
// value with a certain tag for each tag. TensorBoard then remembers which
108+
// tags are associated with which plugins. This saves space.
109+
SummaryMetadata metadata = 9;
110+
90111
// Value associated with the tag.
91112
oneof value {
92113
float simple_value = 2;

src/main/proto/tensorflow/core/framework/tensor.proto

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,18 @@ message TensorProto {
7171
repeated double dcomplex_val = 12 [packed = true];
7272

7373
// DT_RESOURCE
74-
repeated ResourceHandle resource_handle_val = 14;
74+
repeated ResourceHandleProto resource_handle_val = 14;
75+
76+
// DT_VARIANT
77+
repeated VariantTensorDataProto variant_val = 15;
7578
};
79+
80+
// Protocol buffer representing the serialization format of DT_VARIANT tensors.
81+
message VariantTensorDataProto {
82+
// Name of the type of objects being serialized.
83+
string type_name = 1;
84+
// Portions of the object that are not Tensors.
85+
bytes metadata = 2;
86+
// Tensors contained within objects being serialized.
87+
repeated TensorProto tensors = 3;
88+
}

src/main/proto/tensorflow/core/framework/types.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ enum DataType {
3434
DT_COMPLEX128 = 18; // Double-precision complex
3535
DT_HALF = 19;
3636
DT_RESOURCE = 20;
37+
DT_VARIANT = 21; // Arbitrary C++ data types
3738

3839
// TODO(josh11b): DT_GENERIC_PROTO = ??;
3940
// TODO(jeff,josh11b): DT_UINT64? DT_UINT32?
@@ -60,5 +61,6 @@ enum DataType {
6061
DT_COMPLEX128_REF = 118;
6162
DT_HALF_REF = 119;
6263
DT_RESOURCE_REF = 120;
64+
DT_VARIANT_REF = 121;
6365
}
6466
// LINT.ThenChange(https://www.tensorflow.org/code/tensorflow/c/c_api.h,https://www.tensorflow.org/code/tensorflow/go/tensor.go)

0 commit comments

Comments
 (0)