Caffe2 - C++ API
A deep learning, cross platform ML framework
index_hash_ops.cc
1 
17 #include "caffe2/operators/index_hash_ops.h"
18 
19 namespace caffe2 {
20 namespace {
21 
22 REGISTER_CPU_OPERATOR(IndexHash, IndexHashOp<CPUContext>);
23 
24 OPERATOR_SCHEMA(IndexHash)
25  .NumInputs(1)
26  .NumOutputs(1)
27  .SetDoc(R"DOC(
28 This operator translates a list of indices into a list of hashed indices.
29 A seed can be fed as an argument to change the behavior of the hash function.
30 If a modulo is specified, all the hashed indices will be modulo the
31 specified number. All input and output indices are enforced to be positive.
32 )DOC")
33  .Input(0, "Indices", "Input feature indices.")
34  .Output(0, "HashedIndices", "Hashed feature indices.")
35  .Arg("seed", "seed for the hash function")
36  .Arg("modulo", "must be > 0, hashed ids will be modulo this number");
37 
38 SHOULD_NOT_DO_GRADIENT(IndexHash);
39 
40 } // namespace
41 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.