Repository: OpenMined/PySyft

Issue:
addmm tests failing
As of bb1e78015a51de36f58ce5beb74b8f0c120aa131 :

```
$ pytest
===================================================================== test session starts =====================================================================
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
rootdir: /Users/swaroop/personal/openmined/PySyft, inifile:
collected 33 items                                                                                                                                             

tests/test_math.py .......
tests/test_tensor.py ......................FFFF

========================================================================== FAILURES ===========================================================================
______________________________________________________________________ addmm.testaddmm1d ______________________________________________________________________

self = <PySyft.tests.test_tensor.addmm testMethod=testaddmm1d>

    def testaddmm1d(self):
        t1=TensorBase(np.array([1,2,3]))
        t2=TensorBase(np.array([2,3,4]))
        mat=TensorBase(np.array([5]))
        out=t1.addmm(t2,mat,beta=2,alpha=2)
>       self.assertTrue(np.array_equal(out.data,[50]))
E       AssertionError: False is not true

tests/test_tensor.py:127: AssertionError
______________________________________________________________________ addmm.testaddmm2d ______________________________________________________________________

self = <PySyft.tests.test_tensor.addmm testMethod=testaddmm2d>

    def testaddmm2d(self):
        t1=TensorBase(np.array([[1,2],[1,2]]))
        t2=TensorBase(np.array([[1,2],[1,2]]))
        mat=TensorBase(np.array([[2,3],[3,4]]))
        out=t1.addmm(t2,mat,beta=2,alpha=2)
>       self.assertTrue(np.array_equal(out.data,[[10,18],[12,20]]))
E       AssertionError: False is not true

tests/test_tensor.py:134: AssertionError
_____________________________________________________________________ addmm.testaddmm_1d ______________________________________________________________________

self = <PySyft.tests.test_tensor.addmm testMethod=testaddmm_1d>

    def testaddmm_1d(self):
        t1=TensorBase(np.array([1,2,3]))
        t2=TensorBase(np.array([2,3,4]))
        mat=TensorBase(np.array([5]))
        t1.addmm_(t2,mat,beta=2,alpha=2)
>       self.assertTrue(np.array_equal(t1.data,[50]))
E       AssertionError: False is not true

tests/test_tensor.py:141: AssertionError
_____________________________________________________________________ addmm.testaddmm_2d ______________________________________________________________________

self = <PySyft.tests.test_tensor.addmm testMethod=testaddmm_2d>

    def testaddmm_2d(self):
        t1=TensorBase(np.array([[1,2],[1,2]]))
        t2=TensorBase(np.array([[1,2],[1,2]]))
        mat=TensorBase(np.array([[2,3],[3,4]]))
        t1.addmm_(t2,mat,beta=2,alpha=2)
>       self.assertTrue(np.array_equal(t1.data,[[10,18],[12,20]]))
E       AssertionError: False is not true

tests/test_tensor.py:148: AssertionError
============================================================= 4 failed, 29 passed in 0.24 seconds =============================================================
```


Discussion:
The error is coming due to the new inplace implementations of +. I will make the changes with the newer implementation of addmm as disscussed with @samsontmr 
Done

More tests are failing after those were fixed:
![image](https://user-images.githubusercontent.com/6272414/29462390-cdb14a52-83f4-11e7-8782-f1daaa145c12.png)

okay there is a d missing in def will change it

Resolving patch:
diff --git a/syft/math.py b/syft/math.py
--- a/syft/math.py
+++ b/syft/math.py
@@ -101,7 +101,7 @@ def cumprod(tensor,dim=0):
     return TensorBase(np.cumprod(tensor.data,dim))
 
 
-ef addmm(tensor1, tensor2, mat, beta=1, alpha=1):
+def addmm(tensor1, tensor2, mat, beta=1, alpha=1):
         """Performs ((Mat*Beta)+((Tensor1.Tensor2)*Alpha)) and  returns the result as a Tensor
             Tensor1.Tensor2 is performed as Matrix product of two array The behavior depends on the arguments in the following way.
             *If both tensors are 1-dimensional, their dot product is returned.


Test patch: