pytorch/caffe2
Linbin Yu 2fe7fc681d [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34578

Right now C10_EXPORT_CAFFE2_OP_TO_C10_CPU didn't work on mobile since we disabled some code paths. This diff added a new macro to enable these code paths so we can register caffe2 ops in PT mobile.

Test Plan:
verified caffe2 ops are registered in PT mobile
(on the whole stack)

```
_caffe2::BBoxConcatBatchSplits(Tensor[] input_list, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor output)
_caffe2::BBoxTransform(Tensor rois, Tensor deltas, Tensor im_info, float[] weights, bool apply_scale, bool rotated, bool angle_bound_on, int angle_bound_lo, int angle_bound_hi, float clip_angle_thresh, bool legacy_plus_one, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor output_0, Tensor output_1)
_caffe2::BoxWithNMSLimit(Tensor scores, Tensor boxes, Tensor batch_splits, float score_thresh, float nms, int detections_per_im, bool soft_nms_enabled, str soft_nms_method, float soft_nms_sigma, float soft_nms_min_score_thres, bool rotated, bool cls_agnostic_bbox_reg, bool input_boxes_include_bg_cls, bool output_classes_include_bg_cls, bool legacy_plus_one, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor scores, Tensor boxes, Tensor classes, Tensor batch_splits, Tensor keeps, Tensor keeps_size)
_caffe2::GenerateProposals(Tensor scores, Tensor bbox_deltas, Tensor im_info, Tensor anchors, float spatial_scale, int pre_nms_topN, int post_nms_topN, float nms_thresh, float min_size, bool angle_bound_on, int angle_bound_lo, int angle_bound_hi, float clip_angle_thresh, bool legacy_plus_one, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor output_0, Tensor output_1)
_caffe2::HeatmapMaxKeypoint(Tensor heatmaps, Tensor bboxes_in, bool should_output_softmax=True, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor keypoints)
_caffe2::ResizeNearest(Tensor X, str order, float width_scale, float height_scale, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor Y)
_caffe2::RoIAlign(Tensor features, Tensor rois, str order, float spatial_scale, int pooled_h, int pooled_w, int sampling_ratio, bool aligned, Tensor[]? _caffe2_preallocated_outputs=None) -> (Tensor)

Reviewed By: dreiss

Differential Revision: D20128254

fbshipit-source-id: 49a837dddc431eb528b5c72ffdfe0d0131cd10b4
2020-03-11 19:15:14 -07:00
..
contrib Add Scalar::type() (#33603) 2020-02-26 22:25:18 -08:00
core [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578) 2020-03-11 19:15:14 -07:00
cuda_rtc
db [Caffe2] Skip //caffe2/caffe2:caffe2_test_cpu -- 'DBSeekTest\.RocksDB' 2020-02-21 21:30:02 -08:00
distributed
experiments
ideep Enable mkldnn on windows (#31355) 2020-01-27 09:00:02 -08:00
image
mobile Fix spelling errors 2020-01-28 04:46:15 -08:00
mpi
observers preprocessor cleanup (#33957) 2020-03-02 13:37:19 -08:00
onnx
operators fix more errors (#34480) 2020-03-09 14:54:15 -07:00
opt Add backward Int8Quantize shape inference (#34152) 2020-03-03 22:04:25 -08:00
perfkernels [caffe2] simplify caffe2 code with fbgemm handling block size 1 emb (#33774) 2020-02-27 14:45:28 -08:00
predictor
proto Add partition info message to NetDef (#33616) 2020-02-26 14:54:58 -08:00
python [net_transform] only skip ConstantFill for autogen_grad (#34628) 2020-03-11 19:09:52 -07:00
quantization Tuck the packing logic into Int8FCPackWeight op (#34289) 2020-03-05 13:43:08 -08:00
queue
serialize [jit] Add type tags to lists/dicts in pickle (#33255) 2020-03-10 19:17:01 -07:00
sgd preprocessor cleanup (#33957) 2020-03-02 13:37:19 -08:00
share [caffe2] simplify relative error expr (#32999) 2020-02-19 16:35:44 -08:00
test
transforms
utils [net_runner] Get shape info from qtensors (#34321) 2020-03-09 18:34:16 -07:00
video Fix compilation error when buildng with FFMPEG (#27589) 2020-02-13 11:23:48 -08:00
.clang-format
__init__.py
c2_aten_srcs.bzl
CMakeLists.txt [jit] delete netdef converter (#33807) 2020-03-09 22:25:16 -07:00
README.md
release-notes.md
requirements.txt
VERSION_NUMBER

Caffe2

Jenkins Build Status

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.

Questions and Feedback

Please use Github issues (https://github.com/pytorch/pytorch/issues) to ask questions, report bugs, and request new features.

Further Resources on Caffe2.ai