I was also using unbind and stack as the equivalent of apply along axis in numpy. But the greatest problem was that it increased the processing by 2 times. The only way around this problem is to somehow convert the function as matrix operation. Luckily for me I was able replace the axis operation with a series of matrix multiplication.