Add 3d correlation based on blas matrix multiplication 

for half, it depend of the rounding. So multiple input shapes can give the same output shape. So we can't know automatically what was the original shape.