| 21 | namespace tensorflow { |
| 22 | |
| 23 | class VarHandleOp : public OpKernel { |
| 24 | public: |
| 25 | explicit VarHandleOp(OpKernelConstruction* c); |
| 26 | void Compute(OpKernelContext* ctx) override; |
| 27 | |
| 28 | private: |
| 29 | // Same fields as in ResourceHandleOp. |
| 30 | string container_; |
| 31 | string name_; |
| 32 | mutex mutex_; |
| 33 | Tensor resource_; |
| 34 | std::atomic<bool> initialized_{false}; |
| 35 | |
| 36 | DtypeAndPartialTensorShape dtype_and_shape_; |
| 37 | }; |
| 38 | |
| 39 | class ReadVariableOp : public OpKernel { |
| 40 | public: |
no outgoing calls