function fftBatch(input, inverse, cpuBackend) {
    const inputShape = input.shape;
    const batch = inputShape[0];
    const innerDim = inputShape[1];
    const inputVals = cpuBackend.data.get(input.dataId);
    const real2D = inputVals.complexTensorInfos.real;
    const imag2D = inputVals.complexTensorInfos.imag;
    // Collects real and imaginary values separately.
    const resultShape = [
        batch,
        innerDim
    ];
    const resultSize = (0, _tfjsCore.util).sizeFromShape(resultShape);
    const resultReal = (0, _tfjsCore.util).getTypedArrayFromDType("float32", resultSize);
    const resultImag = (0, _tfjsCore.util).getTypedArrayFromDType("float32", resultSize);
    for(let b = 0; b < batch; b++){
        // TODO: Support slice ops for complex type.
        const r = (0, _slice.slice)({
            inputs: {
                x: real2D
            },
            backend: cpuBackend,
            attrs: {
                begin: [
                    b,
                    0
                ],
                size: [
                    1,
                    innerDim
                ]
            }
        });
        const i = (0, _slice.slice)({
            inputs: {
                x: imag2D
            },
            backend: cpuBackend,
            attrs: {
                begin: [
                    b,
                    0
                ],
                size: [
                    1,
                    innerDim
                ]
            }
        });
        const input = (0, _complex.complex)({
            inputs: {
                real: r,
                imag: i
            },
            backend: cpuBackend
        });
        // Run FFT by batch element.
        const { real, imag } = fftImpl(input, inverse, cpuBackend);
        const res = (0, _tfjsCore.backend_util).mergeRealAndImagArrays(real, imag);
        for(let d = 0; d < innerDim; d++){
            const c = (0, _tfjsCore.backend_util).getComplexWithIndex(res, d);
            resultReal[b * innerDim + d] = c.real;
            resultImag[b * innerDim + d] = c.imag;
        }
        cpuBackend.disposeIntermediateTensorInfo(r);
        cpuBackend.disposeIntermediateTensorInfo(i);
        cpuBackend.disposeIntermediateTensorInfo(input);
    }
    const $realInfo = cpuBackend.makeTensorInfo(resultShape, "float32", resultReal);
    const $imagInfo = cpuBackend.makeTensorInfo(resultShape, "float32", resultImag);
    const result = (0, _complex.complex)({
        inputs: {
            real: $realInfo,
            imag: $imagInfo
        },
        backend: cpuBackend
    });
    cpuBackend.disposeIntermediateTensorInfo($realInfo);
    cpuBackend.disposeIntermediateTensorInfo($imagInfo);
    return result;
}
Calculate FFT of inner most elements of batch tensor.