1 #include "caffe2/utils/math/broadcast.h" 3 #include "caffe2/core/context.h" 4 #include "caffe2/utils/eigen_utils.h" 9 #define CAFFE2_SPECIALIZED_AFFINE_CHANNEL(T) \ 11 C10_EXPORT void AffineChannel<T, CPUContext, StorageOrder::NCHW>( \ 20 ConstEigenVectorArrayMap<T> scale_arr(scale, C); \ 21 ConstEigenVectorArrayMap<T> bias_arr(bias, C); \ 22 const int stride = C * HxW; \ 25 for (int i = 0; i < N; ++i) { \ 26 EigenArrayMap<T>(Y_ptr, HxW, C) = \ 27 (ConstEigenArrayMap<T>(X_ptr, HxW, C).rowwise() * \ 28 scale_arr.transpose()) \ 30 bias_arr.transpose(); \ 36 C10_EXPORT void AffineChannel<T, CPUContext, StorageOrder::NHWC>( \ 45 EigenArrayMap<T>(Y, C, N * HxW) = \ 46 (ConstEigenArrayMap<T>(X, C, N * HxW).colwise() * \ 47 ConstEigenVectorArrayMap<T>(scale, C)) \ 49 ConstEigenVectorArrayMap<T>(bias, C); \ 51 CAFFE2_SPECIALIZED_AFFINE_CHANNEL(
float)
52 #undef CAFFE2_SPECIALIZED_AFFINE_CHANNEL A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...