ClippedPadding2D_F64 extends SpatialPadding2D_F64 implements ClippedPadding2D<Tensor_F64> { @Override public int getClippingOffsetRow(int paddedRow) { if( paddedRow < ROW0) return ROW0 - paddedRow; else if( paddedRow > ROW1 ) return ROW1 - paddedRow; return 0; } ClippedPadding2D_F64(ConfigPadding config ); @Override double borderGet(int minibatch, int channel, int row, int col); @Override int getClippingOffsetRow(int paddedRow); @Override int getClippingOffsetCol(int paddedCol); @Override boolean isClipped(); @Override Class<Tensor_F64> getTensorType();  }
@Test public void getClippingOffsetRow() { ClippedPadding2D_F64 alg = createAlg(); Tensor_F64 tensor = TensorFactory_F64.randomMM(rand,false,-1,1, 4,3,6,2); alg.setInput(tensor); assertEquals(3,alg.getClippingOffsetRow(0)); assertEquals(2,alg.getClippingOffsetRow(1)); assertEquals(0,alg.getClippingOffsetRow(3)); assertEquals(0,alg.getClippingOffsetRow(9)); assertEquals(-1,alg.getClippingOffsetRow(10)); assertEquals(-2,alg.getClippingOffsetRow(11)); }