SpatialPadding2D_F32 extends BaseSpatialPadding2D<Tensor_F32> implements VTensor_F32 { @Override public float get(int... coor) { if( coor.length == 4 ) return get(coor[0],coor[1],coor[2],coor[3]); else throw new IllegalArgumentException("Expected 4-DOF spatial tensor"); } SpatialPadding2D_F32(ConfigPadding config); abstract float borderGet(int minibatch, int channel , int row , int col ); @Override float get(int... coor); @Override float get(int axis0); @Override float get(int axis1, int axis0); @Override float get(int axis2, int axis1, int axis0); @Override float get( int minibatch , int channel , int row , int col ); @Override float get(int axis4, int axis3, int axis2, int axis1, int axis0); @Override Class getDataType();  }
@Test public void get_four_all() { ConfigPadding config = new ConfigPadding(); config.x0=1; config.x1=2; config.y0=3; config.y1=4; Helper helper = new Helper(config); Tensor_F32 tensor = TensorFactory_F32.randomMM(rand,false,-1,1, 4,3,6,2); helper.setInput(tensor); assertEquals(tensor.get(1,2,1,0),helper.get(1,2,4,1), DeepBoofConstants.TEST_TOL_F32); assertEquals(tensor.get(1,2,1,0),helper.get(new int[]{1,2,4,1}), DeepBoofConstants.TEST_TOL_F32); assertEquals(1.0f+2.0f,helper.get(1,2,0,0), DeepBoofConstants.TEST_TOL_F32); assertEquals(1.0f+2.0f,helper.get(new int[]{1,2,0,0}), DeepBoofConstants.TEST_TOL_F32); }