aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/lookup_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/framework/lookup_interface.h')
-rw-r--r--tensorflow/core/framework/lookup_interface.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tensorflow/core/framework/lookup_interface.h b/tensorflow/core/framework/lookup_interface.h
index 0622dd06cb..d33945fd1b 100644
--- a/tensorflow/core/framework/lookup_interface.h
+++ b/tensorflow/core/framework/lookup_interface.h
@@ -64,6 +64,17 @@ class LookupInterface : public ResourceBase {
virtual Status Insert(OpKernelContext* ctx, const Tensor& keys,
const Tensor& values) = 0;
+ // Removes elements from the table.
+ // This method is only implemented in mutable tables that can be updated over
+ // the execution of the graph. It returns Status::NotImplemented for read-only
+ // tables that are initialized once before they can be looked up.
+
+ // Returns the following statuses:
+ // - OK: when the remove finishes successfully.
+ // - InvalidArgument: if any of the preconditions on the lookup key fails.
+ // - Unimplemented: if the table does not support removals.
+ virtual Status Remove(OpKernelContext* ctx, const Tensor& keys) = 0;
+
// Returns the number of elements in the table.
virtual size_t size() const = 0;
@@ -107,6 +118,12 @@ class LookupInterface : public ResourceBase {
virtual Status CheckKeyAndValueTensorsForImport(const Tensor& keys,
const Tensor& values);
+ // Check format of the key tensor for the Remove function.
+ // Returns OK if all the following requirements are satisfied, otherwise it
+ // returns InvalidArgument:
+ // - DataType of the tensor keys equals to the table key_dtype
+ virtual Status CheckKeyTensorForRemove(const Tensor& keys);
+
// Check the arguments of a find operation. Returns OK if all the following
// requirements are satisfied, otherwise it returns InvalidArgument:
// - DataType of the tensor keys equals to the table key_dtype