BaseSpatialPadding2D extends BaseTensor implements SpatialPadding2D<T> { public void setInput(T input) { if( input.getDimension() != 4 ) throw new IllegalArgumentException("Expected 4-DOF spatial tensor"); this.input = input; int rows = input.length(2); int cols = input.length(3); COL0 = config.x0; ROW0 = config.y0; COL1 = cols+config.x0; ROW1 = rows+config.y0; this.shape = shapeGivenInput(input.shape); } BaseSpatialPadding2D(ConfigPadding config); void setInput(T input); @Override int getPaddingRow0(); @Override int getPaddingCol0(); @Override int getPaddingRow1(); @Override int getPaddingCol1(); @Override int[] shapeGivenInput( int ...inputShape ); void checkBackwardsShapeChannel( Tensor<T> padded , Tensor<T> original ); void checkBackwardsShapeImage( Tensor<T> padded , Tensor<T> original );  }
@Test public void setInput() { Helper alg = new Helper(config); alg.setInput(new Tensor_F64(3,4,6,7)); assertEquals(2,alg.ROW0); assertEquals(1,alg.COL0); assertEquals(8,alg.ROW1); assertEquals(8,alg.COL1); }