use of com.tencent.angel.ml.matrix.psf.update.Push in project angel by Tencent.
the class UpdateFuncTest method testScale.
@Test
public void testScale() throws Exception {
w2Client.update(new Push(w2Client.getMatrixId(), 3, localArray0)).get();
UpdateFunc func = new Scale(w2Client.getMatrixId(), 3, 2.0);
w2Client.update(func).get();
double[] result = pull(w2Client, 3);
assert (result.length == dim);
for (int i = 0; i < result.length; i++) {
Assert.assertEquals(result[i], localArray0[i] * 2.0, delta);
}
}
use of com.tencent.angel.ml.matrix.psf.update.Push in project angel by Tencent.
the class UpdateFuncTest method testPut.
@Test
public void testPut() throws Exception {
UpdateFunc func = new Push(w2Client.getMatrixId(), 3, localArray0);
w2Client.update(func).get();
double[] result = pull(w2Client, 3);
assert (result.length == dim);
for (int i = 0; i < result.length; i++) {
Assert.assertEquals(result[i], localArray0[i], delta);
}
}
Aggregations