docs: private static INDArray revertTimeSeries(INDArray input, INDArray mask, LayerWorkspaceMgr workspaceMgr, ArrayType type) {
          // Get number of samples
          val n = input.size(0);
  
          // Get maximal length of a time series
          val m = input.size(2);
  
          // Create empty output
          INDArray out = workspaceMgr.create(type, input.dataType(), input.shape(), 'f');
  
          // Iterate over all samples
          for (int s = 0; s < n; s++) {
              long t1 = 0;       // Original time step
              long t2 = m - 1;   // Destination time step
  
              // Revert Sample: Copy from origin (t1) to destination (t2)
              while (t1 < m && t2 >= 0) {
  
                  // If mask is set: ignore padding
                  if (mask != null) {
                      // Origin: find next time step
                      while (t1 < m && mask.getDouble(s, t1) == 0) {
                          t1++;
                      }
                      // Destination: find next time step
                      while (t2 >= 0 && mask.getDouble(s, t2) == 0) {
                          t2--;
                      }
                  }
  
                  // Get the feature vector for the given sample and origin time step
                  // The vector contains features (forward pass) or errors (backward pass)
                  INDArray vec = input.get(
                          NDArrayIndex.point(s),
                          NDArrayIndex.all(),
                          NDArrayIndex.point(t1)
                  );
  
                  // Put the feature vector to the given destination in the output
                  out.put(new INDArrayIndex[]{
                                  NDArrayIndex.point(s),
                                  NDArrayIndex.all(),
                                  NDArrayIndex.point(t2)
                          },
                          vec
                  );
  
                  // Move on
                  t1++;
                  t2--;
              }
          }
  
          // Return the output
          return out;
      }