1 #include "caffe2/operators/dense_vector_to_id_list_op.h" 5 REGISTER_CPU_OPERATOR(DenseVectorToIdList, DenseVectorToIdListOp<CPUContext>);
7 OPERATOR_SCHEMA(DenseVectorToIdList)
11 DenseVectorToIdList: Convert a blob with dense feature into a ID_LIST. 13 An ID_LIST is a list of IDs (may be ints, often longs) that represents a single 14 feature. As described in https://caffe2.ai/docs/sparse-operations.html, a batch 15 of ID_LIST examples is represented as a pair of lengths and values where the 16 `lengths` (int32) segment the `values` or ids (int32/int64) into examples. 18 Input is a single blob where the first dimension is the batch size and the 19 second dimension is the length of dense vectors. This operator produces a 20 ID_LIST where out_values are the indices of non-zero entries 21 and out_lengths are the number of non-zeros entries in each row. 24 .Input(0, "values",
"A data blob of dense vectors")
25 .Output(0,
"out_lengths",
"Lengths of the sparse feature")
26 .Output(1,
"out_values",
"Values of the sparse feature");
27 NO_GRADIENT(DenseVectorToIdList);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...