tensorflow:: אופס:: StringToHashBucketFast

#include <string_ops.h>

ממירה כל מחרוזת ב- Tensor הקלט למוד ה-hash שלה במספר דליים.

סיכום

פונקציית ה-hash היא דטרמיניסטית לגבי תוכן המחרוזת בתוך התהליך ולעולם לא תשתנה. עם זאת, זה לא מתאים להצפנה. ניתן להשתמש בפונקציה זו כאשר זמן ה-CPU מועט והכניסות מהימנות או לא חשובות. קיים סיכון שיריבים יבנו תשומות שכולן גיבוב לאותו דלי. כדי למנוע בעיה זו, השתמש בפונקציית hash חזקה עם tf.string_to_hash_bucket_strong .

דוגמאות:

tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x")], 3).numpy() array([0, 2, 2])

טיעונים:

  • scope: אובייקט Scope
  • קלט: המחרוזות להקצאת דלי hash.
  • num_buckets: מספר הדליים.

החזרות:

בנאים והורסים

StringToHashBucketFast (const :: tensorflow::Scope & scope, :: tensorflow::Input input, int64 num_buckets)

תכונות ציבוריות

operation
output

תפקידים ציבוריים

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

תכונות ציבוריות

מבצע

Operation operation

תְפוּקָה

::tensorflow::Output output

תפקידים ציבוריים

StringToHashBucketFast

 StringToHashBucketFast(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  int64 num_buckets
)

צוֹמֶת

::tensorflow::Node * node() const 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const