pytorch/caffe2/core
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
..
hip
nomnigraph fix warnings reported by PVS (#33868) 2020-03-02 18:51:38 -08:00
__init__.py
allocator.cc
allocator.h
asan.h
blob.h
blob_gpu_test.cc
blob_serialization.cc [ModelLoading] Use byte encoding for uint8, fp16 etc. instead of int32 (#34343) 2020-03-06 11:58:30 -08:00
blob_serialization.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
blob_serialization_gpu.cc
blob_serializer_base.h
blob_stats.cc
blob_stats.h
blob_test.cc [ModelLoading] Use byte encoding for uint8, fp16 etc. instead of int32 (#34343) 2020-03-06 11:58:30 -08:00
CMakeLists.txt get rid of protobuf dependencies (#25650) 2019-09-06 08:48:20 -07:00
common.cc
common.h fix windows clang attributes (#33959) 2020-03-02 13:20:51 -08:00
common_cudnn.cc
common_cudnn.h
common_gpu.cc switch to rocThrust for thrust/cub APIs (#25620) 2019-09-03 22:16:30 -07:00
common_gpu.h Split libtorch.so back into libtorch_{cpu,cuda,hip} (#30315) 2019-12-04 08:04:57 -08:00
common_omp.h
common_test.cc
context.cc
context.h Call RandomNumberSeed() on-demand (#33539) 2020-02-22 01:22:18 -08:00
context_base.cc Remove Tensor.h, TensorMethods.h from src/core. (#27086) 2019-10-06 09:37:50 -07:00
context_base.h Fix is_fundamental template for MSVC (#30959) 2019-12-19 12:10:22 -08:00
context_gpu.cu [caffe2] fix no matching function min/max Clang errors (#33563) 2020-02-28 11:33:24 -08:00
context_gpu.h Fix typos (#30606) 2019-12-02 20:17:42 -08:00
context_gpu_test.cc
context_test.cc
cudnn_wrappers.h
db.cc
db.h
event.cc caffe2/event: allow multiple errors such as when cancelled (#31335) 2019-12-18 13:10:57 -08:00
event.h
event_cpu.h
event_gpu.cc Add error message if CUDA startup fails (#29670) 2019-11-13 16:48:40 -08:00
event_gpu_test.cc
event_test.cc caffe2/event: allow multiple errors such as when cancelled (#31335) 2019-12-18 13:10:57 -08:00
export_c10_op_to_caffe2.cc
export_c10_op_to_caffe2.h Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
export_caffe2_op_to_c10.h [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578) 2020-03-11 19:15:14 -07:00
flags.h
graph.cc
graph.h
graph_test.cc
init.cc
init.h
init_denormals.cc
init_intrinsics_check.cc cleanup warnings 2019-08-12 16:12:30 -07:00
init_omp.cc
init_test.cc
int8_serialization.cc
logging.h
macros.h
macros.h.in Remove duplicated Numa detection code. (#30628) 2020-01-03 08:48:46 -08:00
memonger.cc Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
memonger.h
module.cc Allow checking for cached module before asserting (#33954) 2020-03-02 15:43:50 -08:00
module.h cleanup warnings 2019-08-12 16:12:30 -07:00
module_test.cc
net.cc
net.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
net_async_base.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
net_async_base.h Remove Tensor.h, TensorMethods.h from src/core. (#27086) 2019-10-06 09:37:50 -07:00
net_async_scheduling.cc AsyncIf op implementation 2019-11-07 08:51:31 -08:00
net_async_scheduling.h AsyncIf op implementation 2019-11-07 08:51:31 -08:00
net_async_task.cc
net_async_task.h
net_async_task_future.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
net_async_task_future.h
net_async_task_graph.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
net_async_task_graph.h
net_async_tracing.cc Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
net_async_tracing.h
net_async_tracing_test.cc
net_dag_utils.cc Fix typos (#30606) 2019-12-02 20:17:42 -08:00
net_dag_utils.h
net_dag_utils_test.cc
net_gpu_test.cc
net_parallel.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
net_parallel.h
net_simple.cc Back out "Back out "[Caffe2] Fix device_option propagation"" (#25908) 2019-09-17 04:01:36 -07:00
net_simple.h
net_simple_refcount.cc Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
net_simple_refcount.h
net_simple_refcount_test.cc
net_test.cc fixup unit tests (#34105) 2020-03-03 10:33:21 -08:00
numa.cc
numa.h
observer.h
observer_test.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
operator.cc [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578) 2020-03-11 19:15:14 -07:00
operator.h [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578) 2020-03-11 19:15:14 -07:00
operator_gpu_test.cc
operator_gradient.h
operator_schema.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
operator_schema.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
operator_schema_test.cc
operator_test.cc
parallel_net_test.cc fixup unit tests (#34105) 2020-03-03 10:33:21 -08:00
plan_executor.cc Replace c10::guts::stuff with std::stuff (#30915) 2019-12-16 13:57:19 -08:00
plan_executor.h
prof_dag_counters.cc
prof_dag_counters.h
qtensor.cc
qtensor.h
qtensor_serialization.cc
qtensor_serialization.h
scope_guard.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
static_tracepoint.h
static_tracepoint_elfx86.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
stats.cc
stats.h
stats_test.cc
storage.h
tensor.cc Remove TensorImpl::is_variable, deprecate Tensor::is_variable (#29653) 2019-11-14 11:41:02 -08:00
tensor.h [PT] add macro to expose caffe2 ops to PyTorch mobile (#34578) 2020-03-11 19:15:14 -07:00
tensor_impl.h Remove Tensor.h, TensorMethods.h from src/core. (#27086) 2019-10-06 09:37:50 -07:00
tensor_int8.cc
tensor_int8.h
test_utils.cc C++ C2/Glow operator unittest 2020-01-17 12:13:34 -08:00
test_utils.h C++ C2/Glow operator unittest 2020-01-17 12:13:34 -08:00
timer.h
timer_test.cc
transform.cc
transform.h
transform_test.cc fixup unit tests (#34105) 2020-03-03 10:33:21 -08:00
types.cc
types.h move GetDimFromOrderString to caffe2/core/types.h (#25671) 2019-09-05 04:32:04 -07:00
workspace.cc
workspace.h Fix typos, via a Levenshtein-type corrector (#31523) 2020-01-17 16:03:19 -08:00
workspace_test.cc