How to build a layer to calculate hash value of input tensor

181 views
Skip to first unread message

Jim Davis

unread,
Apr 13, 2021, 10:57:06 PM4/13/21
to TensorFlow Lite
Dear all,

I have a task to build a simple graph to calculate the hash value of the input tensor based on tf.function. For example, my input tensor is [1.0, 2.0] and my output tensor will be [hash(1.0), hash(2.0)]. Is there any built-in operators that I can use? 

I have went over both the Supported Select TensorFlow operator list (https://www.tensorflow.org/lite/guide/op_select_allowlist) and dialect operator list (https://www.tensorflow.org/mlir/tfl_ops#tflhard_swish_tflhardswishop). I was not able to fully understand all the operators. So I just want to check whether there is a suitable built-in operator that I can leverage.

Moreover, the tf.raw_ops.HashTableV2 operator (https://www.tensorflow.org/api_docs/python/tf/raw_ops/HashTableV2) seems to build a hash table based on a set of keys and values. I cannot fully understand the arguments. Is there any other resources that help me understand it? Can I leverage it to do hash value calculation?

Best regards,
Jim

Jaesung Chung

unread,
Apr 13, 2021, 11:08:39 PM4/13/21
to Jim Davis, TensorFlow Lite

If you find any unsupported TF ops when you are using the above TF api, please let us know and we can easily include them through the supported select TensorFlow operator set.

--
You received this message because you are subscribed to the Google Groups "TensorFlow Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tflite+un...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tflite/85f2ae2e-b938-4e4d-8e03-e85f0a2ac6e7n%40tensorflow.org.

Jim Davis

unread,
Apr 15, 2021, 11:53:22 AM4/15/21
to TensorFlow Lite, Jaesung Chung, TensorFlow Lite, Jim Davis
Thanks!
Reply all
Reply to author
Forward
0 new messages