@Test
public void elementSum() {

	List<int[]> shapes = new ArrayList<>();
	shapes.add(new int[]{5});
	shapes.add(new int[]{2,3,4});
	for( boolean subtensor : new boolean[]{false,true}) {
		for( int[] shape : shapes ) {
			Tensor_F32 tensor = TensorFactory_F32.random(rand, subtensor, shape);
			float expected = 0;
			for (int i = 0; i < tensor.length(); i++) {
				expected += tensor.getAtIndex(i);
			}
			float found = TensorOps_F32.elementSum(tensor);
			assertEquals(expected,found,DeepBoofConstants.TEST_TOL_F32);
		}
	}
}