code: public static INDArray reshapeTimeSeriesMaskToVector(INDArray timeSeriesMask) {
          if (timeSeriesMask.rank() != 2)
              throw new IllegalArgumentException("Cannot reshape mask: rank is not 2");
  
          if (timeSeriesMask.ordering() != 'f')
              timeSeriesMask = timeSeriesMask.dup('f');
  
          return timeSeriesMask.reshape('f', timeSeriesMask.length(), 1);
      }
docs: Reshape time series mask arrays. This should match the assumptions (f order, etc) in RnnOutputLayer
  @param timeSeriesMask    Mask array to reshape to a column vector
  @return                  Mask array as a column vector