       paddings[1] = std::make_pair(0, static_cast<int>(w_odd));
       paddings[2] = std::make_pair(0, 0);
       paddings[3] = std::make_pair(0, 0);
-      padded_x.tb<3>().device(*dev.edevice) = xs[0]->tb<3>().pad(paddings);
+      tb<3>(padded_x).device(*dev.edevice) = tb<3>(*xs[0]).pad(paddings);
       // re-point x to the padded input
       XH = new_XH;
       XW = new_XW;

                  &beta, filter_desc_, dxi));
      //accumlate the gradient
      Tensor dxi_tensor = Tensor(Dim({FH, FW, FXC}, FYC), static_cast<float*>(dxi), xs[1]->device, DeviceMempool::FXS);
      dEdxi.t<4>().device(*dev.edevice) += dxi_tensor.t<4>();
    } break;
    case 2: {// grad w.r.t. bias
      dxi = scratch_allocator->allocate(sizeof(float) * FYC);


#include "dynet/dynet.h"
#include "dynet/virtual-cudnn.h"
#include "tensor-eigen.h"
#include "dynet/cudnn-ops.h"

using namespace cudnn;
