commit | 85d0bfb6f3e9c7f40a4f4d02a74d726fab0c70a0 | [log] [tgz] |
---|---|---|
author | Jiyan Yang <chocjy@fb.com> | Fri Oct 06 11:57:56 2017 -0700 |
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | Fri Oct 06 12:06:39 2017 -0700 |
tree | 56e9027d1cc69bd534a1a3a977a86c70a66f4fb6 | |
parent | 4362c4de9c108e103b8de9fffaf0ab7adca68cfa [diff] |
Cuda SparseLabelSplitOp Summary: This is a brief introduction to what this op is doing. In the multi-label case, i.e., each example has more than one label, we want to find out which examples have values for each label. That is, given a sparse representation in len = (2,3), ind = (1, 2, 0, 1, 2), val = (10, 20, 5, 8, 15), we want to return example_id_0 = [1], example_id_1 = [0,1], example_id_2 = [0,1], value_0 = [5], value_1 = [10,8], value_2 = [20,15]. There are two special things here. 1. The size of each output tensor is unknown until runtime; 2. The ordering in each output tensor should be preserved, e.g., example_id_1 = [0,1] instead of [1,0]. What I am doing now is to get the output size and an offset map (see codes) in cpu and then launch a kernel to take care of the rest. This requires a copy of O(N) which is really not ideal. Previously I had an implementation that computes the output size in gpu but when I fill values in the output tensors it is hard to make sure the ordering will be preserved unless I do a sorting afterwards. Reviewed By: azzolini Differential Revision: D5825104 fbshipit-source-id: 4d987cef0247746998ec1d2acc47fc5ed2302722
Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.
Caffe2 research award competition request for proposals
Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.
Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.
Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.