1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. |
---|---|
2 | |
3 | Licensed under the Apache License, Version 2.0 (the "License"); |
4 | |
5 | You may obtain a copy of the License at |
6 | |
7 | http://www.apache.org/licenses/LICENSE-2.0 |
8 | |
9 | Unless required by applicable law or agreed to in writing, software |
10 | distributed under the License is distributed on an "AS IS" BASIS, |
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | See the License for the specific language governing permissions and |
13 | limitations under the License. |
14 | ==============================================================================*/ |
15 | #include "tensorflow/core/framework/common_shape_fns.h" |
16 | #include "tensorflow/core/framework/op.h" |
17 | #include "tensorflow/core/framework/shape_inference.h" |
18 | |
19 | namespace tensorflow { |
20 | |
21 | REGISTER_OP("SummaryWriter") |
22 | .Output("writer: resource") |
23 | .Attr("shared_name: string = ''") |
24 | .Attr("container: string = ''") |
25 | .SetShapeFn(shape_inference::ScalarShape); |
26 | |
27 | REGISTER_OP("CreateSummaryFileWriter") |
28 | .Input("writer: resource") |
29 | .Input("logdir: string") |
30 | .Input("max_queue: int32") |
31 | .Input("flush_millis: int32") |
32 | .Input("filename_suffix: string") |
33 | .SetShapeFn(shape_inference::NoOutputs); |
34 | |
35 | REGISTER_OP("CreateSummaryDbWriter") |
36 | .Input("writer: resource") |
37 | .Input("db_uri: string") |
38 | .Input("experiment_name: string") |
39 | .Input("run_name: string") |
40 | .Input("user_name: string") |
41 | .SetShapeFn(shape_inference::NoOutputs); |
42 | |
43 | REGISTER_OP("FlushSummaryWriter") |
44 | .Input("writer: resource") |
45 | .SetShapeFn(shape_inference::NoOutputs); |
46 | |
47 | REGISTER_OP("CloseSummaryWriter") |
48 | .Input("writer: resource") |
49 | .SetShapeFn(shape_inference::NoOutputs); |
50 | |
51 | REGISTER_OP("WriteSummary") |
52 | .Input("writer: resource") |
53 | .Input("step: int64") |
54 | .Input("tensor: T") |
55 | .Input("tag: string") |
56 | .Input("summary_metadata: string") |
57 | .Attr("T: type") |
58 | .SetShapeFn(shape_inference::NoOutputs); |
59 | |
60 | REGISTER_OP("WriteRawProtoSummary") |
61 | .Input("writer: resource") |
62 | .Input("step: int64") |
63 | .Input("tensor: string") |
64 | .SetShapeFn(shape_inference::NoOutputs); |
65 | |
66 | REGISTER_OP("ImportEvent") |
67 | .Input("writer: resource") |
68 | .Input("event: string") |
69 | .SetShapeFn(shape_inference::NoOutputs); |
70 | |
71 | REGISTER_OP("WriteScalarSummary") |
72 | .Input("writer: resource") |
73 | .Input("step: int64") |
74 | .Input("tag: string") |
75 | .Input("value: T") |
76 | .Attr("T: realnumbertype") |
77 | .SetShapeFn(shape_inference::NoOutputs); |
78 | |
79 | REGISTER_OP("WriteHistogramSummary") |
80 | .Input("writer: resource") |
81 | .Input("step: int64") |
82 | .Input("tag: string") |
83 | .Input("values: T") |
84 | .Attr("T: {realnumbertype, bool} = DT_FLOAT") |
85 | .SetShapeFn(shape_inference::NoOutputs); |
86 | |
87 | REGISTER_OP("WriteImageSummary") |
88 | .Input("writer: resource") |
89 | .Input("step: int64") |
90 | .Input("tag: string") |
91 | .Input("tensor: T") |
92 | .Input("bad_color: uint8") |
93 | .Attr("max_images: int >= 1 = 3") |
94 | .Attr("T: {uint8, double, float, half} = DT_FLOAT") |
95 | .SetShapeFn(shape_inference::NoOutputs); |
96 | |
97 | REGISTER_OP("WriteAudioSummary") |
98 | .Input("writer: resource") |
99 | .Input("step: int64") |
100 | .Input("tag: string") |
101 | .Input("tensor: float") |
102 | .Input("sample_rate: float") |
103 | .Attr("max_outputs: int >= 1 = 3") |
104 | .SetShapeFn(shape_inference::NoOutputs); |
105 | |
106 | REGISTER_OP("WriteGraphSummary") |
107 | .Input("writer: resource") |
108 | .Input("step: int64") |
109 | .Input("tensor: string") |
110 | .SetShapeFn(shape_inference::NoOutputs); |
111 | |
112 | } // namespace tensorflow |
113 |