TensorOps_F64 { public static void fill( Tensor_F64 tensor , double value ) { Arrays.fill(tensor.d,tensor.startIndex,tensor.startIndex+tensor.length(),value); }  static void elementMult(Tensor_F64 tensor , double value  ); static void elementMult(Tensor_F64 input , double value , Tensor_F64 output ); static void elementMult(Tensor_F64 A , Tensor_F64 B , Tensor_F64 output ); static void elementAdd(Tensor_F64 A , Tensor_F64 B , Tensor_F64 output ); static double elementSum( Tensor_F64 tensor ); static void insertSubChannel( Tensor_F64 src , int srcStartIndex , int srcStride ,
										 Tensor_F64 dst , int dstStartIndex , int dstStride ,
										 int rows , int columns ); static void insertSpatial(Tensor_F64 src , int []srcCoor,
									 Tensor_F64 dst , int []dstCoor ); static void fillSpatialBorder(Tensor_F64 tensor , int[] coor ,
										 int borderY0 , int borderX0 , int borderY1 , int borderX1 ,
										 double value ); static void printSpatial( Tensor_F64 tensor , int batch , int channel ); static void fill( Tensor_F64 tensor , double value );  }
@Test public void fill() { Tensor_F64 a = new Tensor_F64(1,2,3,4); TensorOps_F64.fill(a,2.0); for (int i = 0; i < a.d.length; i++) { assertEquals(2.0,a.d[i], DeepBoofConstants.TEST_TOL_F64); } a = a.subtensor(5,new int[]{4}); TensorOps_F64.fill(a,3.0); for (int i = 0; i < 5; i++) { assertEquals(2.0,a.d[i], DeepBoofConstants.TEST_TOL_F64); } for (int i = 0; i < 4; i++) { assertEquals(3.0,a.d[a.startIndex+i], DeepBoofConstants.TEST_TOL_F64); } }