Tensor implements Serializable { public final int getCols() { return cols; } Tensor(final float... values);  Tensor(final float[][] vals);  Tensor(final float[][][] vals);  Tensor(final float[][][][] vals);  Tensor(int cols);  Tensor(int cols, float val);  Tensor(int rows, int cols);  Tensor(int rows, int cols, float[] values);  Tensor(int rows, int cols, int depth);  Tensor(int rows, int cols, int depth, int fourthDim);  Tensor(int rows, int cols, int depth, float[] values); private  Tensor(Tensor t); final float get(final int idx); final float set(final int idx, final float val); final float get(final int row, final int col); final void set(final int row, final int col, final float val); final float get(final int row, final int col, final int z); final void set(final int row, final int col,  final int z, final float val); final float get(final int row, final int col, final int z, final int fourth); final void set(final int row, final int col, final int z, final int fourth, final float val); final float[] getValues(); final void setValues(float... values); final void copyFrom(float[] src); final int getCols(); final int getRows(); final int getDepth(); final int getFourthDim(); final int getDimensions(); @Override String toString(); final void add(final int row, final int col, final float value); void add(final int row, final int col, final int z, final float value); final void add(final int row, final int col, final int z, final int fourth, final float value); final void add(final int idx, final float value); final void add(Tensor t); final void sub(final int row, final int col, final float value); final void sub(final int row, final int col, final int z, final float value); final void sub(final int row, final int col, final int z, final int fourth, final float value); final void sub(final Tensor t); final static void sub(final Tensor t1, final Tensor t2); final void div(final float value); final void fill(final float value); static final void fill(final float[] array, final float val); static void div(final float[] array, final float val); static final void sub(final float[] array1, final float[] array2); static final void add(final float[] array1, final float[] array2); static final void copy(final Tensor src, final Tensor dest); static final void copy(final float[] src, final float[] dest); @Override boolean equals(Object obj); boolean equals(Tensor t2, float delta); static Tensor zeros(int cols); static Tensor ones(int cols); static String valuesAsString(Tensor[] tensors); void setValuesFromString(String values); static Tensor create(int rows, int cols, float[] values);  }
@Test public void testGetCols() { Tensor instance = new Tensor(5); int expResult = 5; int result = instance.getCols(); assertEquals(expResult, result); }