function createSimpleBinaryKernelImpl(op) {
    return (aShape, bShape, aVals, bVals, dtype)=>{
        const newShape = (0, _tfjsCore.backend_util).assertAndGetBroadcastShape(aShape, bShape);
        const resultRank = newShape.length;
        const resultStrides = (0, _tfjsCore.util).computeStrides(newShape);
        const resultSize = (0, _tfjsCore.util).sizeFromShape(newShape);
        const result = (0, _tfjsCore.util).getTypedArrayFromDType(dtype, resultSize);
        const aRank = aShape.length;
        const bRank = bShape.length;
        const aStrides = (0, _tfjsCore.util).computeStrides(aShape);
        const bStrides = (0, _tfjsCore.util).computeStrides(bShape);
        const aBroadcastDims = (0, _tfjsCore.backend_util).getBroadcastDims(aShape, newShape);
        const bBroadcastDims = (0, _tfjsCore.backend_util).getBroadcastDims(bShape, newShape);
        if (aBroadcastDims.length + bBroadcastDims.length === 0) for(let i = 0; i < result.length; ++i)result[i] = op(aVals[i % aVals.length], bVals[i % bVals.length]);
        else for(let i = 0; i < result.length; ++i){
            const loc = (0, _tfjsCore.util).indexToLoc(i, resultRank, resultStrides);
            const aLoc = loc.slice(-aRank);
            aBroadcastDims.forEach((d)=>aLoc[d] = 0);
            const aIndex = (0, _tfjsCore.util).locToIndex(aLoc, aRank, aStrides);
            const bLoc = loc.slice(-bRank);
            bBroadcastDims.forEach((d)=>bLoc[d] = 0);
            const bIndex = (0, _tfjsCore.util).locToIndex(bLoc, bRank, bStrides);
            result[i] = op(aVals[aIndex], bVals[bIndex]);
        }
        return [
            result,
            newShape
        ];
    };
}
Template that creates implementation for binary ops. Supports broadcast.