     }
   }
   Tensor<float> * reshaped_relu3_top = Tensor<float>::TensorCPUtoGPU(reshaped_relu3_top_cpu);
+  Tensor<float> * reshaped_relu3_top_diff = Tensor<float>::CreateTensorGPU(to_fc4_dims);
   // flatten the tensor
   // Tensor<float>::ReshapeTensorGPU(relu3_top, to_fc4_dims);
   Tensor<float>::ReshapeTensorGPU(reshaped_relu3_top, to_fc4_dims);

    cel_layer.Backward({cel_top}, {cel_top}, {sm_top, data_tops[1]}, {sm_top_diff, cel_loss_diff});
    softmax.Backward({sm_top}, {sm_top_diff}, {fc5_top}, {fc5_top_diff});
    fc5.Backward({fc5_top}, {fc5_top_diff}, {fc4_top}, {fc4_top_diff});
    fc4.Backward({fc4_top}, {fc4_top_diff}, {relu3_top}, {relu3_top_diff});
    Tensor<float>::ReshapeTensorGPU(relu3_top, relu3_top_dims);
    Tensor<float>::ReshapeTensorGPU(relu3_top_diff, relu3_top_dims);

    cudaStatus = cudaGetLastError();
    checkCudaErrors(cudaStatus);
    relu3.Backward({pool3_top}, {pool3_top_diff}, {relu3_top}, {relu3_top_diff});
    cudaStatus = cudaGetLastError();
    checkCudaErrors(cudaStatus);

  relu3.GetTopsDims({pool3_top_dims}, {relu3_top_dims});
  Tensor<float> * relu3_top = Tensor<float>::CreateTensorGPU(relu3_top_dims);
  Tensor<float> * relu3_top_diff = Tensor<float>::CreateTensorGPU(relu3_top_dims);


  size_t to_fc4_dims[4];
  to_fc4_dims[0] = relu3_top_dims[0];
