docs: public static INDArray cnn1dMaskReduction(INDArray in, int kernel, int stride, int padding, int dilation, ConvolutionMode cm){
          Preconditions.checkState(in.rank()==2, "Rank must be 2 for cnn1d mask array - shape ", in.shape());
          if(cm == ConvolutionMode.Same && stride == 1 ){
              return in;
          }
  
          if(!Shape.hasDefaultStridesForShape(in)){
              in = in.dup();
          }
  
          INDArray reshaped4d = in.reshape(in.size(0), 1, in.size(1), 1);
  
          int[] outSize;
          int[] pad;
          int[] k = new int[]{kernel,1};
          int[] s = new int[]{stride, 1};
          int[] d = new int[]{dilation, 1};
          if (cm == ConvolutionMode.Same) {
              outSize = ConvolutionUtils.getOutputSize(reshaped4d, k, s, null, cm, d); //Also performs validation
          } else {
              pad = new int[]{padding, 0};
              outSize = ConvolutionUtils.getOutputSize(reshaped4d, k, s, pad, cm, d); //Also performs validation
          }
          int outH = outSize[0];
  
          INDArray output = Nd4j.createUninitialized(new int[]{(int)in.size(0), 1, outH, 1}, 'c');
  
          Op op = new LegacyPooling2D(reshaped4d, kernel, 1, stride, 1, padding, 0, dilation, 1,
                  cm == ConvolutionMode.Same, LegacyPooling2D.Pooling2DType.MAX, 0.0, output);
          Nd4j.getExecutioner().exec(op);
          return output.reshape('c', in.size(0), outH);
      }