#ifndef CAFFE2_OPERATORS_ELEMENTWISE_OPS_UTILS_H_ #define CAFFE2_OPERATORS_ELEMENTWISE_OPS_UTILS_H_ #include #include #include "caffe2/core/context.h" #include "caffe2/core/tensor.h" namespace caffe2 { namespace elementwise_ops_utils { TORCH_API std::tuple ComputeLegacyBroadcastSizes(const Tensor& A, const Tensor& B, int axis); TORCH_API std::vector ComputeBinaryBroadcastForwardDims( const c10::ArrayRef& A_dims, const c10::ArrayRef& B_dims); TORCH_API void ComputeBinaryBroadcastBackwardAxes( const std::vector& A_dims, const std::vector& B_dims, std::vector* A_axes, std::vector* B_axes); TORCH_API void ComputeBinaryBroadcastBackwardDims( const std::vector& A_dims, const std::vector& B_dims, std::vector* A_back_dims, std::vector* B_back_dims); } // namespace elementwise_ops_utils } // namespace caffe2 #endif // CAFFE2_OPERATORS_ELEMENTWISE_OPS_UTILS_H_