Created by: grygielski
Suggested in https://github.com/PaddlePaddle/Paddle/pull/19510# changes to make it easier to switch to MKLDNN v1.0 in the future. I didn't change it in Tensor class because we plan to apply some changes there anyway and I was close to 20 file limit in this PR.