1 #include "caffe2/operators/find_duplicate_elements_op.h" 7 FindDuplicateElementsOp<CPUContext>);
9 OPERATOR_SCHEMA(FindDuplicateElements)
13 The *FindDuplicateElements* op takes a single 1-D tensor *data* as input and returns a single 1-D output tensor *indices*. The output tensor contains the indices of the duplicate elements of the input, excluding the first occurrences. If all elements of *data* are unique, *indices* will be empty. 17 - https://github.com/caffe2/caffe2/blob/master/caffe2/operators/find_duplicate_elements_op.h 18 - https://github.com/caffe2/caffe2/blob/master/caffe2/operators/find_duplicate_elements_op.cc 23 <summary> <b>Example</b> </summary> 29 workspace.ResetWorkspace() 31 op = core.CreateOperator( 32 "FindDuplicateElements", 37 workspace.FeedBlob("data", np.array([8,2,1,1,7,8,1]).astype(np.float32)) 38 print("data:\n", workspace.FetchBlob("data")) 40 workspace.RunOperatorOnce(op) 41 print("indices: \n", workspace.FetchBlob("indices")) 50 [8. 2. 1. 1. 7. 8. 1.] 60 .Input(0, "data",
"a 1-D tensor.")
64 "Indices of duplicate elements in data, excluding first occurrences.");
66 SHOULD_NOT_DO_GRADIENT(FindDuplicateElements);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...