     cudaStatus = cudaGetLastError();
     checkCudaErrors(cudaStatus);
 
-    calc_out_diff<<<1,1>>>(out_tensor_diff, out_tensor, y_out);
+    // calc_out_diff<<<1,1>>>(out_tensor_diff, out_tensor, y_out);
+    calc_out_diff<<<1,1>>>(softmax_out_tensor_diff, softmax_out_tensor, y_out);
+    cudaStatus = cudaGetLastError();
+    checkCudaErrors(cudaStatus);
+
+    softmax_layer.Backward({softmax_out_tensor}, {softmax_out_tensor_diff}, {out_tensor}, {out_tensor_diff});
     cudaStatus = cudaGetLastError();
     checkCudaErrors(cudaStatus);
 

  size_t out_dims[4];
  out.GetTopsDims({h1_dims}, {out_dims});


  Tensor<float>* in_tensor = Tensor<float>::CreateTensorCPU(in_dims);
  Tensor<float>* in_tensor_diff = Tensor<float>::CreateTensorCPU(in_dims);


  cudaFree(out_tensor);
  cudaFree(out_tensor_diff);
  cudaFree(softmax_out_tensor);
  cudaFree(softmax_out_tensor_diff);
}


