aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/string_to_hash_bucket_op.cc
diff options
context:
space:
mode:
authorGravatar Yutaka Leon <yutaka.leon@gmail.com>2016-05-17 14:11:13 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-05-17 15:22:14 -0700
commit5228e8b724224c00582f082faee22bfcc3c14f10 (patch)
tree65b083b3d2b994b41635d84e743e050765d08f1b /tensorflow/core/kernels/string_to_hash_bucket_op.cc
parent4d55cb5c55fcc85009171b6a4657cbd966fd85e5 (diff)
Added string_to_hash_bucket_stable, which uses fingerprint64
Marked string_to_hash_bucket as deprecated Change: 122569503
Diffstat (limited to 'tensorflow/core/kernels/string_to_hash_bucket_op.cc')
-rw-r--r--tensorflow/core/kernels/string_to_hash_bucket_op.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/tensorflow/core/kernels/string_to_hash_bucket_op.cc b/tensorflow/core/kernels/string_to_hash_bucket_op.cc
index 539648a676..3a2429d4cd 100644
--- a/tensorflow/core/kernels/string_to_hash_bucket_op.cc
+++ b/tensorflow/core/kernels/string_to_hash_bucket_op.cc
@@ -13,20 +13,19 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
-#include <string>
+#include "tensorflow/core/kernels/string_to_hash_bucket_op.h"
-#include "tensorflow/core/framework/op_kernel.h"
-#include "tensorflow/core/framework/tensor.h"
-#include "tensorflow/core/lib/core/errors.h"
-#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/hash/hash.h"
-#include "tensorflow/core/platform/macros.h"
+#include "tensorflow/core/platform/fingerprint.h"
namespace tensorflow {
-class StringToHashBucketOp : public OpKernel {
+// Deprecated class. It also uses `string_tensor` as Op argument instead of
+// `input`.
+class LegacyStringToHashBuckeOp : public OpKernel {
public:
- explicit StringToHashBucketOp(OpKernelConstruction* ctx) : OpKernel(ctx) {
+ explicit LegacyStringToHashBuckeOp(OpKernelConstruction* ctx)
+ : OpKernel(ctx) {
OP_REQUIRES_OK(ctx, ctx->GetAttr("num_buckets", &num_buckets_));
}
@@ -55,10 +54,14 @@ class StringToHashBucketOp : public OpKernel {
private:
int64 num_buckets_;
- TF_DISALLOW_COPY_AND_ASSIGN(StringToHashBucketOp);
+ TF_DISALLOW_COPY_AND_ASSIGN(LegacyStringToHashBuckeOp);
};
+// StringToHashBucket is deprecated in favor of StringToHashBucketStable.
REGISTER_KERNEL_BUILDER(Name("StringToHashBucket").Device(DEVICE_CPU),
- StringToHashBucketOp);
+ LegacyStringToHashBuckeOp);
+
+REGISTER_KERNEL_BUILDER(Name("StringToHashBucketFast").Device(DEVICE_CPU),
+ StringToHashBucketOp<Fingerprint64>);
} // namespace tensorflow