Caffe2 - C++ API
A deep learning, cross platform ML framework
find_op.cc
1 
17 #include "caffe2/operators/find_op.h"
18 
19 namespace caffe2 {
20 
21 OPERATOR_SCHEMA(Find)
22  .NumInputs(2)
23  .NumOutputs(1)
24  .IdenticalTypeAndShapeOfInput(1)
25  .Input(0, "index", "Index (integers)")
26  .Input(1, "query", "Needles / query")
27  .Output(
28  0,
29  "query_indices",
30  "Indices of the needles in index or 'missing value'")
31  .Arg("missing_value", "Placeholder for items that are not found")
32  .SetDoc(R"DOC(
33 Finds elements of second input from first input,
34 outputting the last (max) index for each query.
35 If query not find, inserts missing_value.
36 See IndexGet() for a version that modifies the index when
37 values are not found.
38 )DOC");
39 
40 REGISTER_CPU_OPERATOR(Find, FindOp<CPUContext>)
41 
42 } // namespace caffe2
Copyright (c) 2016-present, Facebook, Inc.