| 188 | .SetShapeFn(shape_inference::ScalarShape); |
| 189 | |
| 190 | Output ConstructOp(const Scope& scope, const string& op_type, |
| 191 | const gtl::ArraySlice<Input>& inputs) { |
| 192 | if (!scope.ok()) return Output(); |
| 193 | const string unique_name = scope.GetUniqueNameForOp(op_type); |
| 194 | auto builder = |
| 195 | NodeBuilder(unique_name, op_type, scope.graph()->op_registry()); |
| 196 | for (auto const& input : inputs) { |
| 197 | builder.Input(ops::NodeOut(input.node(), input.index())); |
| 198 | } |
| 199 | scope.UpdateBuilder(&builder); |
| 200 | Node* ret; |
| 201 | scope.UpdateStatus(builder.Finalize(scope.graph(), &ret)); |
| 202 | if (!scope.ok()) return Output(); |
| 203 | scope.UpdateStatus(scope.DoShapeInference(ret)); |
| 204 | if (!scope.ok()) return Output(); |
| 205 | return Output(ret); |
| 206 | } |
| 207 | |
| 208 | Output ConstructOp(const Scope& scope, const string& op_type, |
| 209 | const string &device, |
no test coverage detected