@Test public void when_inputHasIncorrectShape_expect_outputWithCorrectShape() { INDArray input = Nd4j.create(new double[] { 1.0, 2.0, 3.0}); INDArray output = INDArrayHelper.forceCorrectShape(input); assertEquals(2, output.shape().length); assertEquals(1, output.shape()[0]); assertEquals(3, output.shape()[1]); }
public static INDArray forceCorrectShape(INDArray source) { return source.shape()[0] == 1 && source.rank() > 1 ? source : Nd4j.expandDims(source, 0); }
INDArrayHelper { public static INDArray forceCorrectShape(INDArray source) { return source.shape()[0] == 1 && source.rank() > 1 ? source : Nd4j.expandDims(source, 0); } }
INDArrayHelper { public static INDArray forceCorrectShape(INDArray source) { return source.shape()[0] == 1 && source.rank() > 1 ? source : Nd4j.expandDims(source, 0); }  }
INDArrayHelper { public static INDArray forceCorrectShape(INDArray source) { return source.shape()[0] == 1 && source.rank() > 1 ? source : Nd4j.expandDims(source, 0); }  static INDArray forceCorrectShape(INDArray source); static INDArray createBatchForShape(long batchSize, long... shape); static INDArray createRnnBatchForShape(long batchSize, long... shape); }
INDArrayHelper { public static INDArray forceCorrectShape(INDArray source) { return source.shape()[0] == 1 && source.rank() > 1 ? source : Nd4j.expandDims(source, 0); }  static INDArray forceCorrectShape(INDArray source); static INDArray createBatchForShape(long batchSize, long... shape); static INDArray createRnnBatchForShape(long batchSize, long... shape);  }