The 3D version has size of BxCxDxHxW. However, your implement just simple 2D version BxCxHxW for both 3D and 2D version. I guess somthing wrong