 
   if (t != result) {
     THCTensor_(resizeAs)(state, result, t);
-    THCTensor_(copy)(state, result, t);
+    if (ScalarConvert<real, double>::to(beta) != 0.0) {
+      THCTensor_(copy)(state, result, t);
+    }
   }
 
   THCTensor *slice1 = THCTensor_(new)(state);


  if (t != result) {
    THCTensor_(resizeAs)(state, result, t);
    THCTensor_(copy)(state, result, t);
  }

  bool transpose_result;


    THCTensor_(addmm)(state, r_, beta, tAsMatrix, alpha, mat, vecAsMatrix);

    // r_ will have answer as matrix, need to return a vector
    THCTensor_(resize1d)(state, r_, r_->size[0]);
    THCTensor_(free)(state, vecAsMatrix);
    THCTensor_(free)(state, tAsMatrix);
