MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Compute

Method Compute

tensorflow/core/kernels/tensor_array_ops.cc:1449–1461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
1464REGISTER_KERNEL_BUILDER(Name("TensorArrayClose").Device(DEVICE_CPU),

Callers

nothing calls this directly

Calls 2

GetTensorArrayFunction · 0.85
ClearAndMarkClosedMethod · 0.80

Tested by

no test coverage detected