TensorFlow函數:tf.string_to_hash_bucket

2018-03-21 13:47 更新

tf.string_to_hash_bucket函數

tf.string_to_hash_bucket(
    string_tensor,
    num_buckets,
    name=None
)

請參閱指南:字符串操作>散列

通過多個 bucket 將輸入張量中的每個字符串轉換為哈希模式.

哈希函數對進程內字符串的內容是確定性的.

請注意,哈希函數可能會不時地變化.此功能將被棄用,建議使用 tf.string_to_hash_bucket_fast() 或 tf.string_to_hash_bucket_strong(),這將在下節(jié)內容中進行介紹.

函數參數:

  • string_tensor:一個 string 類型的 Tensor.
  • num_buckets:一個大于等于1的 int,bucket 的數量.
  • name:操作的名稱(可選).

函數返回值:

tf.string_to_hash_bucket函數返回一個 int64 類型的 Tensor.

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號