aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-09-12 15:13:43 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-12 15:17:58 -0700
commitb9424f1b93d5d0d6e6600d8324f95409590348f2 (patch)
tree57107d98449d09f1cd749a9e09b604b8c7738038 /tensorflow/core/framework
parentce73fa866f421ca9da4763b3d6128a0724265e8c (diff)
Mark the ResourceHandleOp as inexpensive.
Previously, we would schedule a closure for each ResourceHandleOp, because it is erroneously considered to be "expensive". This would cost several microseconds per op, whereas the execution cost of this kernel is as little as 100ns. This change causes these kernels to execute inline at the beginning of a step. PiperOrigin-RevId: 212712378
Diffstat (limited to 'tensorflow/core/framework')
-rw-r--r--tensorflow/core/framework/resource_mgr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/core/framework/resource_mgr.h b/tensorflow/core/framework/resource_mgr.h
index f87dc1e39d..d58deaa3fc 100644
--- a/tensorflow/core/framework/resource_mgr.h
+++ b/tensorflow/core/framework/resource_mgr.h
@@ -348,6 +348,8 @@ class ResourceHandleOp : public OpKernel {
void Compute(OpKernelContext* ctx) override;
+ bool IsExpensive() override { return false; }
+
private:
string container_;
string name_;