| 1447 | : OpKernel(context) {} |
| 1448 | |
| 1449 | void Compute(OpKernelContext* ctx) override { |
| 1450 | TensorArray* tensor_array; |
| 1451 | OP_REQUIRES_OK(ctx, GetTensorArray(ctx, &tensor_array)); |
| 1452 | core::ScopedUnref unref(tensor_array); |
| 1453 | // Instead of deleting this TA from the ResourceManager, we just |
| 1454 | // clear it away and mark it as closed. The remaining memory |
| 1455 | // consumed store its mutex and handle Tensor. This will be |
| 1456 | // cleared out at the end of the step anyway, so it's fine to keep |
| 1457 | // it around until the end of the step. Further calls to the |
| 1458 | // TensorArray will fail because TensorArray checks internally to |
| 1459 | // see if it is closed or not. |
| 1460 | tensor_array->ClearAndMarkClosed(); |
| 1461 | } |
| 1462 | }; |
| 1463 | |
| 1464 | REGISTER_KERNEL_BUILDER(Name("TensorArrayClose").Device(DEVICE_CPU), |
nothing calls this directly
no test coverage detected