string_to_hash_bucket_fast 中的名称参数有什么用?

What's the name arguments in string_to_hash_bucket_fast for?

刚刚接触 tensorflow。在检查 feature_column.categorical_column_with_hash_bucket 的 impl 时,我发现了这段代码:

sparse_id_values = string_ops.string_to_hash_bucket_fast(sparse_values, 
self.hash_bucket_size, name='lookup')

不知道这里为什么要用name='lookup',跟lookup_ops.py有关系吗? tf.string_to_hash_bucket_fast 中指定的文档:

name: A name for the operation (optional).

但不是很明白,试图深入源码,发现它被包裹在go/wrapper的一个接口中,连一个详细的algo impl都找不到。有什么建议吗?

tf.string_to_hash_bucket_fast() creates an actual op in the graph. It's called StringToHashBucketFast in the native implementation, see the source code in tensorflow/core/kernels/string_to_hash_bucket_op.cc。特别是,它有一个梯度。所以这个名字有助于在图中识别这个操作,例如在 tensorboard 中。

这个地方的名字lookup解释了sparse_id_values的意思:是sparse_values到ids(hashes)的转换。