| 646 | |
| 647 | namespace { |
| 648 | Node* MakeRead(const Scope& scope, const string& id, |
| 649 | Node** var_handle_op = nullptr) { |
| 650 | Output var_handle = |
| 651 | ops::VarHandleOp(scope.WithOpName("Var" + id), DT_FLOAT, TensorShape({})); |
| 652 | Output read = |
| 653 | ops::ReadVariableOp(scope.WithOpName("Read" + id), var_handle, DT_FLOAT); |
| 654 | if (var_handle_op) { |
| 655 | *var_handle_op = var_handle.node(); |
| 656 | } |
| 657 | return read.node(); |
| 658 | } |
| 659 | |
| 660 | Node* MakeWrite(const Scope& scope, const string& id) { |
| 661 | Output var_handle = |
no test coverage detected