ValuesProvider vp = TensorFactory.tensorProvider(c, 2, true);
float[] src = new float[] { 1.6f, 1.6f, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.4f, 2.4f };
System.arraycopy(src, 0, vp.get(c.getInputLayer()).getElements(), vp.get(c.getInputLayer()).getStartIndex(), src.length);
AparapiStochasticPooling2D calc = new AparapiStochasticPooling2D();
calc.calculate(connections, vp, c.getOutputLayer());
Tensor t = vp.get(c.getOutputLayer());
assertEquals(2.08, t.get(0, 0, 0, 0), 0.01);
assertEquals(2.08, t.get(0, 0, 0, 1), 0.01);