Skip to content

Commit ba6ddaf

Browse files
xw285cornellfacebook-github-bot
authored andcommitted
[pyper] export caffe2 bucketize GPU operator to pytorch
Summary: Exporting the Bucketize operator on CUDA. Also adding unit test. Test Plan: buck test mode/dev-nosan caffe2/torch/fb/sparsenn:gpu_test -- test_bucketize Differential Revision: D23581321 fbshipit-source-id: 7f21862984c04d840410b8718db93006f526938a
1 parent e0c65ab commit ba6ddaf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

caffe2/operators/bucketize_op.cu

+6
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ bool BucketizeOp<CUDAContext>::RunOnDevice() {
5252
5353
REGISTER_CUDA_OPERATOR(Bucketize, BucketizeOp<CUDAContext>);
5454
} // namespace caffe2
55+
56+
using BucketizeCUDA = caffe2::BucketizeOp<caffe2::CUDAContext>;
57+
58+
C10_EXPORT_CAFFE2_OP_TO_C10_CUDA(
59+
Bucketize,
60+
BucketizeCUDA);

caffe2/operators/bucketize_op.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "caffe2/core/operator.h"
1010
#include "caffe2/utils/math.h"
1111

12-
C10_DECLARE_EXPORT_CAFFE2_OP_TO_C10(BucketizeOp);
12+
C10_DECLARE_EXPORT_CAFFE2_OP_TO_C10(Bucketize);
1313

1414
namespace caffe2 {
1515

0 commit comments

Comments
 (0)