Added wrapper for tensordot that handles 0-length dimensions consistently with np.dot