Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::StringToHashBucketFast
#include <string_ops.h>
Converts each string in the input Tensor to its hash mod by a number of buckets.
Summary
The hash function is deterministic on the content of the string within the process and will never change. However, it is not suitable for cryptography. This function may be used when CPU time is scarce and inputs are trusted or unimportant. There is a risk of adversaries constructing inputs that all hash to the same bucket. To prevent this problem, use a strong hash function with tf.string_to_hash_bucket_strong
.
Arguments:
- scope: A Scope object
- input: The strings to assign a hash bucket.
- num_buckets: The number of buckets.
Returns:
Output
: A Tensor of the same shape as the input string_tensor
.
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-04-20 UTC.
[null,null,["Last updated 2020-04-20 UTC."],[],[],null,["# tensorflow::ops::StringToHashBucketFast Class Reference\n\ntensorflow::ops::StringToHashBucketFast\n=======================================\n\n`#include \u003cstring_ops.h\u003e`\n\nConverts each string in the input [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets.\n\nSummary\n-------\n\nThe hash function is deterministic on the content of the string within the process and will never change. However, it is not suitable for cryptography. This function may be used when CPU time is scarce and inputs are trusted or unimportant. There is a risk of adversaries constructing inputs that all hash to the same bucket. To prevent this problem, use a strong hash function with `tf.string_to_hash_bucket_strong`.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: The strings to assign a hash bucket.\n- num_buckets: The number of buckets.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of the same shape as the input `string_tensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [StringToHashBucketFast](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1aeb05e5b10fdc6f834f05a653d410f7f7)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, int64 num_buckets)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a0952b49db809f413e63d82b3f012df4f) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a18fa68753ab137a6da6fdd02e1eca30f) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1ae3368d6c128d5c8bd06c2ba972391f6e)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1adc1ece493cd1b706ea7d316631c56148)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_fast_1a0a330a80b9f8aa32ee15556dd3e68aa4)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### StringToHashBucketFast\n\n```gdscript\n StringToHashBucketFast(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n int64 num_buckets\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]