@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_F64 tensor = TensorFactory_F64.random(rand, subtensor, shape);
			double expected = 0;
			for (int i = 0; i < tensor.length(); i++) {
				expected += tensor.getAtIndex(i);
			}
			double found = TensorOps_F64.elementSum(tensor);
			assertEquals(expected,found,DeepBoofConstants.TEST_TOL_F64);
		}
	}
}