// Generated by using torchexport::export() -> do not edit by hand
#pragma once

#ifdef _WIN32
#ifndef TORCHVISIONLIB_HEADERS_ONLY
#define TORCHVISIONLIB_API extern "C" __declspec(dllexport)
#else
#define TORCHVISIONLIB_API extern "C" __declspec(dllimport)
#endif
#else
#define TORCHVISIONLIB_API extern "C"
#endif

#ifndef TORCHVISIONLIB_HANDLE_EXCEPTION
#define TORCHVISIONLIB_HANDLE_EXCEPTION                                  \
catch(const std::exception& ex) {                                  \
  p_torchvisionlib_last_error = make_raw::string(ex.what());             \
} catch (std::string& ex) {                                        \
  p_torchvisionlib_last_error = make_raw::string(ex);                    \
} catch (...) {                                                    \
  p_torchvisionlib_last_error = make_raw::string("Unknown error. ");     \
}
#endif

void host_exception_handler ();
extern void* p_torchvisionlib_last_error;
TORCHVISIONLIB_API void* torchvisionlib_last_error ();
TORCHVISIONLIB_API void torchvisionlib_last_error_clear();

TORCHVISIONLIB_API void* _vision_ops_nms (void* dets, void* scores, double iou_threshold);
TORCHVISIONLIB_API void* _vision_ops_deform_conv2d (void* input, void* weight, void* offset, void* mask, void* bias, std::int64_t stride_h, std::int64_t stride_w, std::int64_t pad_h, std::int64_t pad_w, std::int64_t dilation_h, std::int64_t dilation_w, std::int64_t groups, std::int64_t offset_groups, bool use_mask);
TORCHVISIONLIB_API void* _vision_ops_ps_roi_align (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width, int64_t sampling_ratio);
TORCHVISIONLIB_API void* _vision_ops_ps_roi_pool (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width);
TORCHVISIONLIB_API void* _vision_ops_roi_align (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width, int64_t sampling_ratio, bool aligned);
TORCHVISIONLIB_API void* _vision_ops_roi_pool (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width);
TORCHVISIONLIB_API void* _vision_read_jpeg (void* fpath);
TORCHVISIONLIB_API void* _vision_read_jpeg_float (void* fpath);
TORCHVISIONLIB_API void _delete_tensor_pair (void* x);
TORCHVISIONLIB_API void* _tensor_pair_get_first (void* x);
TORCHVISIONLIB_API void* _tensor_pair_get_second (void* x);

#ifdef RCPP_VERSION
inline void* vision_ops_nms (void* dets, void* scores, double iou_threshold) {
  auto ret =  _vision_ops_nms(dets, scores, iou_threshold);
  host_exception_handler();
  return ret;
}
inline void* vision_ops_deform_conv2d (void* input, void* weight, void* offset, void* mask, void* bias, std::int64_t stride_h, std::int64_t stride_w, std::int64_t pad_h, std::int64_t pad_w, std::int64_t dilation_h, std::int64_t dilation_w, std::int64_t groups, std::int64_t offset_groups, bool use_mask) {
  auto ret =  _vision_ops_deform_conv2d(input, weight, offset, mask, bias, stride_h, stride_w, pad_h, pad_w, dilation_h, dilation_w, groups, offset_groups, use_mask);
  host_exception_handler();
  return ret;
}
inline void* vision_ops_ps_roi_align (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width, int64_t sampling_ratio) {
  auto ret =  _vision_ops_ps_roi_align(input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio);
  host_exception_handler();
  return ret;
}
inline void* vision_ops_ps_roi_pool (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width) {
  auto ret =  _vision_ops_ps_roi_pool(input, rois, spatial_scale, pooled_height, pooled_width);
  host_exception_handler();
  return ret;
}
inline void* vision_ops_roi_align (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width, int64_t sampling_ratio, bool aligned) {
  auto ret =  _vision_ops_roi_align(input, rois, spatial_scale, pooled_height, pooled_width, sampling_ratio, aligned);
  host_exception_handler();
  return ret;
}
inline void* vision_ops_roi_pool (void* input, void* rois, double spatial_scale, int64_t pooled_height, int64_t pooled_width) {
  auto ret =  _vision_ops_roi_pool(input, rois, spatial_scale, pooled_height, pooled_width);
  host_exception_handler();
  return ret;
}
inline void* vision_read_jpeg (void* fpath) {
  auto ret =  _vision_read_jpeg(fpath);
  host_exception_handler();
  return ret;
}
inline void* vision_read_jpeg_float (void* fpath) {
  auto ret =  _vision_read_jpeg_float(fpath);
  host_exception_handler();
  return ret;
}
inline void delete_tensor_pair (void* x) {
   _delete_tensor_pair(x);
  host_exception_handler();
  
}
inline void* tensor_pair_get_first (void* x) {
  auto ret =  _tensor_pair_get_first(x);
  host_exception_handler();
  return ret;
}
inline void* tensor_pair_get_second (void* x) {
  auto ret =  _tensor_pair_get_second(x);
  host_exception_handler();
  return ret;
}
#endif // RCPP_VERSION
