@Override
    public INDArray ones(int[] shape) {
        //ensure shapes that wind up being scalar end up with the write shape
        if (shape.length == 1 && shape[0] == 0) {
            shape = new int[] {1, 1};
        }

        INDArray ret = create(shape);
        ret.assign(1);
        return ret;
    }
@ Override public INDArray ones ( int [ ] shape ) { if ( shape . length == 1 && shape [ 0 ] == 0 ) { shape = new int [ ] { 1 , 1 } ; } INDArray ret = create ( shape ) ; ret . assign ( 1 ) ; return ret ; }
Create an ndarray of ones

@param shape the shape of the ndarray
@return an ndarray with ones filled in