Program: 3289
Project: 3289
Buggy source:
@Test public void testNdVectorOp(){
  Nd4j.getRandom().setSeed(12345);
  int[] maxShape=new int[]{5,7,9,11,13,15};
  for (int opNum=0; opNum < 6; opNum++) {
    for (int rank=2; rank < maxShape.length; rank++) {
      int[] shape=Arrays.copyOfRange(maxShape,0,rank);
      INDArray orig=Nd4j.rand(shape);
      for (int i=0; i < rank; i++) {
        INDArray arr=orig.dup();
        int eleStride=arr.tensorAlongDimension(0,i).elementWiseStride();
        INDArray vector=i == 0 ? Nd4j.rand(1,shape[i]) : Nd4j.rand(shape[i],1);
        System.out.println("String_Node_Str" + rank + "String_Node_Str"+ i+ "String_Node_Str"+ vector+ "String_Node_Str"+ Arrays.toString(arr.shape()));
        BroadcastOp op;
switch (opNum) {
case 0:
          op=new BroadcastAddOp(arr,vector,arr.dup(),i);
        break;
case 1:
      op=new BroadcastCopyOp(arr,vector,arr,i);
    break;
case 2:
  op=new BroadcastDivOp(arr,vector,arr.dup(),i);
break;
case 3:
op=new BroadcastMulOp(arr,vector,arr.dup(),i);
break;
case 4:
op=new BroadcastRDivOp(arr,vector,arr.dup(),i);
break;
case 5:
op=new BroadcastRSubOp(arr,vector,arr.dup(),i);
break;
case 6:
op=new BroadcastSubOp(arr,vector,arr.dup(),i);
break;
default :
throw new RuntimeException();
}
StopWatch watch=new StopWatch();
watch.start();
System.out.println("String_Node_Str" + op.name());
Nd4j.getExecutioner().exec(op);
watch.stop();
System.out.println("String_Node_Str" + watch.getNanoTime() + "String_Node_Str"+ op.x().tensorssAlongDimension(i));
INDArray assertion=arr.dup();
for (int j=0; j < arr.tensorssAlongDimension(i); j++) {
switch (opNum) {
case 0:
assertion.tensorAlongDimension(j,i).addi(vector);
break;
case 1:
assertion.tensorAlongDimension(j,i).assign(vector);
break;
case 2:
assertion.tensorAlongDimension(j,i).divi(vector);
break;
case 3:
assertion.tensorAlongDimension(j,i).muli(vector);
break;
case 4:
assertion.tensorAlongDimension(j,i).rdivi(vector);
break;
case 5:
assertion.tensorAlongDimension(j,i).rsubi(vector);
break;
case 6:
assertion.tensorAlongDimension(j,i).subi(vector);
break;
default :
throw new RuntimeException();
}
}
assertEquals(assertion,op.z());
}
}
}
}

Fixed version (ground truth):
@Test public void testNdVectorOp(){
  Nd4j.getRandom().setSeed(12345);
  int[] maxShape=new int[]{5,7,9,11,13,15};
  for (int opNum=0; opNum < 6; opNum++) {
    for (int rank=2; rank < maxShape.length; rank++) {
      int[] shape=Arrays.copyOfRange(maxShape,0,rank);
      INDArray orig=Nd4j.rand(shape);
      for (int i=0; i < rank; i++) {
        INDArray arr=orig.dup();
        INDArray vector=i == 0 ? Nd4j.rand(1,shape[i]) : Nd4j.rand(shape[i],1);
        System.out.println("String_Node_Str" + rank + "String_Node_Str"+ i+ "String_Node_Str"+ vector+ "String_Node_Str"+ Arrays.toString(arr.shape()));
        BroadcastOp op;
switch (opNum) {
case 0:
          op=new BroadcastAddOp(arr,vector,arr.dup(),i);
        break;
case 1:
      op=new BroadcastCopyOp(arr,vector,arr,i);
    break;
case 2:
  op=new BroadcastDivOp(arr,vector,arr.dup(),i);
break;
case 3:
op=new BroadcastMulOp(arr,vector,arr.dup(),i);
break;
case 4:
op=new BroadcastRDivOp(arr,vector,arr.dup(),i);
break;
case 5:
op=new BroadcastRSubOp(arr,vector,arr.dup(),i);
break;
case 6:
op=new BroadcastSubOp(arr,vector,arr.dup(),i);
break;
default :
throw new RuntimeException();
}
StopWatch watch=new StopWatch();
watch.start();
System.out.println("String_Node_Str" + op.name());
Nd4j.getExecutioner().exec(op);
watch.stop();
System.out.println("String_Node_Str" + watch.getNanoTime() + "String_Node_Str"+ op.x().tensorssAlongDimension(i));
INDArray assertion=arr.dup();
for (int j=0; j < arr.tensorssAlongDimension(i); j++) {
switch (opNum) {
case 0:
assertion.tensorAlongDimension(j,i).addi(vector);
break;
case 1:
assertion.tensorAlongDimension(j,i).assign(vector);
break;
case 2:
assertion.tensorAlongDimension(j,i).divi(vector);
break;
case 3:
assertion.tensorAlongDimension(j,i).muli(vector);
break;
case 4:
assertion.tensorAlongDimension(j,i).rdivi(vector);
break;
case 5:
assertion.tensorAlongDimension(j,i).rsubi(vector);
break;
case 6:
assertion.tensorAlongDimension(j,i).subi(vector);
break;
default :
throw new RuntimeException();
}
}
assertEquals(assertion,op.z());
}
}
}
}