Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/FBGEMM.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaya Khudia <dskhudia@fb.com>2019-07-16 03:34:48 +0300
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-07-16 03:47:37 +0300
commite69972dad13a116049a8f9e6657c74ac5d04207a (patch)
tree4b17ed7a4626330194771070a64e825915fc21f5 /src
parent1568107cd14e5b2b8abaafa212156d64778660dd (diff)
unpack through unified convolution interface (#105)
Summary: Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/105 Support for calling unpack using unified interface for packing convolution weights Reviewed By: jianyuh Differential Revision: D16190534 fbshipit-source-id: daebd7b6d1846921232f8391c816e2f0678d813f
Diffstat (limited to 'src')
-rw-r--r--src/PackWeightsForConv.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/PackWeightsForConv.cc b/src/PackWeightsForConv.cc
index 78379af..e16843c 100644
--- a/src/PackWeightsForConv.cc
+++ b/src/PackWeightsForConv.cc
@@ -65,6 +65,21 @@ PackWeightsForConv<SPATIAL_DIM, T, accT>::PackWeightsForConv(
} // switch
}
+template <int SPATIAL_DIM, typename T, typename accT>
+void PackWeightsForConv<SPATIAL_DIM, T, accT>::unpack(T* origin_buf) {
+ if (W_dw_2D_packed_) {
+ W_dw_2D_packed_->unpack(origin_buf);
+ } else if (W_dw_3D_packed_) {
+ W_dw_3D_packed_->unpack(origin_buf);
+ } else if (W_gconv_packed_) {
+ W_gconv_packed_->unpack(origin_buf);
+ } else if (W_im2col_packed_) {
+ W_im2col_packed_->unpack(origin_buf);
+ } else {
+ assert(false && "At least one packed weights object should exist");
+ }
+}
+
template class PackWeightsForConv<2, int8_t, int32_t>;
template class PackWeightsForConv<3, int8_t, int32_t>;