Program: 3294
Project: 3294
Buggy source:
@Override public void invokeAsync(){
  INDArray x=op.x();
  INDArray y=op.y();
  int tensorDim;
  if (y == null)   tensorDim=OpExecutionerUtil.chooseElementWiseTensorDimension(x);
 else   tensorDim=OpExecutionerUtil.chooseElementWiseTensorDimension(x,y);
  int nTensors=x.tensorssAlongDimension(tensorDim);
  subTasks=new ArrayList<>(nTensors);
  if (nTensors == 1) {
    Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,false);
    task.invokeAsync();
    subTasks.add(task);
  }
 else {
    if (x.rank() == 2) {
      OpExecutionerUtil.Tensor1DStats tsx=OpExecutionerUtil.get1DTensorStats(x,tensorDim);
      int n=tsx.getTensorLength();
      int incrX=tsx.getElementWiseStride();
      DataBuffer dx=x.data();
      if (y == null) {
        for (int i=0; i < nTensors; i++) {
          int offsetX=tsx.getFirstTensorOffset() + i * tsx.getTensorStartSeparation();
          int elementOffset=i * tsx.getTensorLength();
          Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,n,offsetX,0,incrX,0,elementOffset,false);
          task.invokeAsync();
          subTasks.add(task);
        }
      }
 else {
        DataBuffer dy=y.data();
        OpExecutionerUtil.Tensor1DStats tsy=OpExecutionerUtil.get1DTensorStats(y,tensorDim);
        int incrY=tsy.getElementWiseStride();
        for (int i=0; i < nTensors; i++) {
          int offsetX=tsx.getFirstTensorOffset() + i * tsx.getTensorStartSeparation();
          int offsetY=tsy.getFirstTensorOffset() + i * tsy.getTensorStartSeparation();
          int elementOffset=i * tsx.getTensorLength();
          Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,n,offsetX,offsetY,incrX,incrY,elementOffset,false);
          task.invokeAsync();
          subTasks.add(task);
        }
      }
    }
 else {
      for (int i=0; i < nTensors; i++) {
        Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,i,tensorDim,false);
        task.invokeAsync();
        subTasks.add(task);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void invokeAsync(){
  INDArray x=op.x();
  INDArray y=op.y();
  int tensorDim=1;
  int nTensors=x.tensorssAlongDimension(tensorDim);
  subTasks=new ArrayList<>(nTensors);
  if (nTensors == 1) {
    Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,false);
    task.invokeAsync();
    subTasks.add(task);
  }
 else {
    if (x.rank() == 2) {
      OpExecutionerUtil.Tensor1DStats tsx=OpExecutionerUtil.get1DTensorStats(x,tensorDim);
      int n=tsx.getTensorLength();
      int incrX=tsx.getElementWiseStride();
      DataBuffer dx=x.data();
      if (y == null) {
        for (int i=0; i < nTensors; i++) {
          int offsetX=tsx.getFirstTensorOffset() + i * tsx.getTensorStartSeparation();
          int elementOffset=i * tsx.getTensorLength();
          Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,n,offsetX,0,incrX,0,elementOffset,false);
          task.invokeAsync();
          subTasks.add(task);
        }
      }
 else {
        DataBuffer dy=y.data();
        OpExecutionerUtil.Tensor1DStats tsy=OpExecutionerUtil.get1DTensorStats(y,tensorDim);
        int incrY=tsy.getElementWiseStride();
        for (int i=0; i < nTensors; i++) {
          int offsetX=tsx.getFirstTensorOffset() + i * tsx.getTensorStartSeparation();
          int offsetY=tsy.getFirstTensorOffset() + i * tsy.getTensorStartSeparation();
          int elementOffset=i * tsx.getTensorLength();
          Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,n,offsetX,offsetY,incrX,incrY,elementOffset,false);
          task.invokeAsync();
          subTasks.add(task);
        }
      }
    }
 else {
      for (int i=0; i < nTensors; i++) {
        Task<Pair<Double,Integer>> task=new CPUIndexAccumulationTask(op,threshold,i,tensorDim,false);
        task.invokeAsync();
        subTasks.add(task);
      }
    }
  }
}