1 | // This file is MACHINE GENERATED! Do not edit. |
2 | |
3 | |
4 | #include "tensorflow/cc/ops/const_op.h" |
5 | #include "tensorflow/cc/ops/data_flow_ops_internal.h" |
6 | |
7 | namespace tensorflow { |
8 | namespace ops { |
9 | namespace internal { |
10 | // NOTE: This namespace has internal TensorFlow details that |
11 | // are not part of TensorFlow's public API. |
12 | |
13 | ResourceAccumulatorApplyGradient::ResourceAccumulatorApplyGradient(const |
14 | ::tensorflow::Scope& |
15 | scope, |
16 | ::tensorflow::Input |
17 | handle, |
18 | ::tensorflow::Input |
19 | local_step, |
20 | ::tensorflow::Input |
21 | gradient) { |
22 | if (!scope.ok()) return; |
23 | auto _handle = ::tensorflow::ops::AsNodeOut(scope, handle); |
24 | if (!scope.ok()) return; |
25 | auto _local_step = ::tensorflow::ops::AsNodeOut(scope, local_step); |
26 | if (!scope.ok()) return; |
27 | auto _gradient = ::tensorflow::ops::AsNodeOut(scope, gradient); |
28 | if (!scope.ok()) return; |
29 | ::tensorflow::Node* ret; |
30 | const auto unique_name = scope.GetUniqueNameForOp("ResourceAccumulatorApplyGradient" ); |
31 | auto builder = ::tensorflow::NodeBuilder(unique_name, "ResourceAccumulatorApplyGradient" ) |
32 | .Input(_handle) |
33 | .Input(_local_step) |
34 | .Input(_gradient) |
35 | ; |
36 | scope.UpdateBuilder(&builder); |
37 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
38 | if (!scope.ok()) return; |
39 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
40 | this->operation = Operation(ret); |
41 | return; |
42 | } |
43 | |
44 | ResourceAccumulatorNumAccumulated::ResourceAccumulatorNumAccumulated(const |
45 | ::tensorflow::Scope& |
46 | scope, |
47 | ::tensorflow::Input |
48 | handle) { |
49 | if (!scope.ok()) return; |
50 | auto _handle = ::tensorflow::ops::AsNodeOut(scope, handle); |
51 | if (!scope.ok()) return; |
52 | ::tensorflow::Node* ret; |
53 | const auto unique_name = scope.GetUniqueNameForOp("ResourceAccumulatorNumAccumulated" ); |
54 | auto builder = ::tensorflow::NodeBuilder(unique_name, "ResourceAccumulatorNumAccumulated" ) |
55 | .Input(_handle) |
56 | ; |
57 | scope.UpdateBuilder(&builder); |
58 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
59 | if (!scope.ok()) return; |
60 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
61 | this->operation = Operation(ret); |
62 | this->num_accumulated = Output(ret, 0); |
63 | } |
64 | |
65 | ResourceAccumulatorSetGlobalStep::ResourceAccumulatorSetGlobalStep(const |
66 | ::tensorflow::Scope& |
67 | scope, |
68 | ::tensorflow::Input |
69 | handle, |
70 | ::tensorflow::Input |
71 | new_global_step) { |
72 | if (!scope.ok()) return; |
73 | auto _handle = ::tensorflow::ops::AsNodeOut(scope, handle); |
74 | if (!scope.ok()) return; |
75 | auto _new_global_step = ::tensorflow::ops::AsNodeOut(scope, new_global_step); |
76 | if (!scope.ok()) return; |
77 | ::tensorflow::Node* ret; |
78 | const auto unique_name = scope.GetUniqueNameForOp("ResourceAccumulatorSetGlobalStep" ); |
79 | auto builder = ::tensorflow::NodeBuilder(unique_name, "ResourceAccumulatorSetGlobalStep" ) |
80 | .Input(_handle) |
81 | .Input(_new_global_step) |
82 | ; |
83 | scope.UpdateBuilder(&builder); |
84 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
85 | if (!scope.ok()) return; |
86 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
87 | this->operation = Operation(ret); |
88 | return; |
89 | } |
90 | |
91 | ResourceAccumulatorTakeGradient::ResourceAccumulatorTakeGradient(const |
92 | ::tensorflow::Scope& |
93 | scope, |
94 | ::tensorflow::Input |
95 | handle, |
96 | ::tensorflow::Input |
97 | num_required, |
98 | DataType |
99 | dtype) { |
100 | if (!scope.ok()) return; |
101 | auto _handle = ::tensorflow::ops::AsNodeOut(scope, handle); |
102 | if (!scope.ok()) return; |
103 | auto _num_required = ::tensorflow::ops::AsNodeOut(scope, num_required); |
104 | if (!scope.ok()) return; |
105 | ::tensorflow::Node* ret; |
106 | const auto unique_name = scope.GetUniqueNameForOp("ResourceAccumulatorTakeGradient" ); |
107 | auto builder = ::tensorflow::NodeBuilder(unique_name, "ResourceAccumulatorTakeGradient" ) |
108 | .Input(_handle) |
109 | .Input(_num_required) |
110 | .Attr("dtype" , dtype) |
111 | ; |
112 | scope.UpdateBuilder(&builder); |
113 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
114 | if (!scope.ok()) return; |
115 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
116 | this->operation = Operation(ret); |
117 | this->average = Output(ret, 0); |
118 | } |
119 | |
120 | ResourceConditionalAccumulator::ResourceConditionalAccumulator(const |
121 | ::tensorflow::Scope& |
122 | scope, DataType |
123 | dtype, |
124 | PartialTensorShape |
125 | shape, const |
126 | ResourceConditionalAccumulator::Attrs& |
127 | attrs) { |
128 | if (!scope.ok()) return; |
129 | ::tensorflow::Node* ret; |
130 | const auto unique_name = scope.GetUniqueNameForOp("ResourceConditionalAccumulator" ); |
131 | auto builder = ::tensorflow::NodeBuilder(unique_name, "ResourceConditionalAccumulator" ) |
132 | .Attr("dtype" , dtype) |
133 | .Attr("shape" , shape) |
134 | .Attr("container" , attrs.container_) |
135 | .Attr("shared_name" , attrs.shared_name_) |
136 | .Attr("reduction_type" , attrs.reduction_type_) |
137 | ; |
138 | scope.UpdateBuilder(&builder); |
139 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
140 | if (!scope.ok()) return; |
141 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
142 | this->operation = Operation(ret); |
143 | this->handle = Output(ret, 0); |
144 | } |
145 | |
146 | ResourceConditionalAccumulator::ResourceConditionalAccumulator(const |
147 | ::tensorflow::Scope& |
148 | scope, DataType |
149 | dtype, |
150 | PartialTensorShape |
151 | shape) |
152 | : ResourceConditionalAccumulator(scope, dtype, shape, ResourceConditionalAccumulator::Attrs()) {} |
153 | |
154 | } // namespace internal |
155 | } // namespace ops |
156 | } // namespace tensorflow |
157 | |