Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
fluxo tensor:: ops:: StringToHashBucketFast
#include <string_ops.h>
Converte cada string no Tensor de entrada em seu mod hash por um número de buckets.
Resumo
A função hash é determinística quanto ao conteúdo da string dentro do processo e nunca será alterada. No entanto, não é adequado para criptografia. Esta função pode ser usada quando o tempo de CPU é escasso e as entradas são confiáveis ou sem importância. Existe o risco de adversários construírem entradas que sejam todas hash no mesmo intervalo. Para evitar esse problema, use uma função hash forte com tf.string_to_hash_bucket_strong
.
Argumentos:
- escopo: um objeto Escopo
- entrada: as strings para atribuir um bucket de hash.
- num_buckets: o número de intervalos.
Retorna:
-
Output
: um tensor do mesmo formato da entrada string_tensor
.
Atributos públicos
Funções públicas
nó
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operador::tensorflow::Saída
operator::tensorflow::Output() const
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-25 UTC.
[null,null,["Última atualização 2025-07-25 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/r2.1/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/r2.1/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/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A [Tensor](/versions/r2.1/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/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/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/r2.1/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/r2.1/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```"]]