diff options
author | 2016-05-17 14:11:13 -0800 | |
---|---|---|
committer | 2016-05-17 15:22:14 -0700 | |
commit | 5228e8b724224c00582f082faee22bfcc3c14f10 (patch) | |
tree | 65b083b3d2b994b41635d84e743e050765d08f1b /tensorflow/core/kernels/string_to_hash_bucket_op.cc | |
parent | 4d55cb5c55fcc85009171b6a4657cbd966fd85e5 (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.cc | 23 |
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 |