docs: public static INDArray reverseTimeSeriesMask(INDArray mask, LayerWorkspaceMgr workspaceMgr, ArrayType arrayType){
          if(mask == null){
              return null;
          }
          if(mask.rank() == 3){
              //Should normally not be used - but handle the per-output masking case
              return reverseTimeSeries(mask, workspaceMgr, arrayType);
          } else if(mask.rank() != 2){
              throw new IllegalArgumentException("Invalid mask rank: must be rank 2 or 3. Got rank " + mask.rank()
                      + " with shape " + Arrays.toString(mask.shape()));
          }
  
          // FIXME: int cast
          int[] idxs = new int[(int) mask.size(1)];
          int j=0;
          for( int i=idxs.length-1; i>=0; i--){
              idxs[j++] = i;
          }
  
          INDArray ret = workspaceMgr.createUninitialized(arrayType, mask.dataType(), new long[]{mask.size(0), idxs.length}, 'f');
  
          return Nd4j.pullRows(mask, ret, 0, idxs);
  
          /*
          //Assume input mask is 2d: [minibatch, tsLength]
          INDArray out = Nd4j.createUninitialized(mask.shape(), 'f');
          CustomOp op = DynamicCustomOp.builder("reverse")
                  .addIntegerArguments(new int[]{1})
                  .addInputs(mask)
                  .addOutputs(out)
                  .callInplace(false)
                  .build();
          Nd4j.getExecutioner().exec(op);
          return out;
          */
      }