function fusedConv2d_({ x, filter, strides, pad, dataFormat = "NHWC", dilations = [
    1,
    1
], dimRoundingMode, bias, activation = "linear", preluActivationWeights, leakyreluAlpha }) {
    activation = activation || "linear";
    if ((0, _fusedUtil.shouldFuse)((0, _engine.ENGINE).state.gradientDepth, activation) === false) {
        // TODO: Transpose bias and preluActivationWeights properly for NCHW
        // format before computation.
        _util.assert(dataFormat === "NHWC", ()=>`Error in fused conv2d: got dataFormat of ${dataFormat} but ` + `only NHWC is currently supported for the case of gradient depth ` + `is 0 and the activation is not linear.`);
        let result = (0, _conv2D.conv2d)(x, filter, strides, pad, dataFormat, dilations, dimRoundingMode);
        if (bias != null) result = (0, _add.add)(result, bias);
        return (0, _fusedUtil.applyActivation)(result, activation, preluActivationWeights, leakyreluAlpha);
    }
    const $x = (0, _tensorUtilEnv.convertToTensor)(x, "x", "conv2d", "float32");
    const $filter = (0, _tensorUtilEnv.convertToTensor)(filter, "filter", "conv2d", "float32");
    let x4D = $x;
    let reshapedTo4D = false;
    if ($x.rank === 3) {
        reshapedTo4D = true;
        x4D = (0, _reshape.reshape)($x, [
            1,
            $x.shape[0],
            $x.shape[1],
            $x.shape[2]
        ]);
    }
    _util.assert(x4D.rank === 4, ()=>`Error in fused conv2d: input must be rank 4, but got rank ` + `${x4D.rank}.`);
    _util.assert($filter.rank === 4, ()=>`Error in fused conv2d: filter must be rank 4, but got rank ` + `${$filter.rank}.`);
    _convUtil.checkPadOnDimRoundingMode("fused conv2d", pad, dimRoundingMode);
    const inputChannels = dataFormat === "NHWC" ? x4D.shape[3] : x4D.shape[1];
    _util.assert($filter.shape[2] === inputChannels, ()=>`Error in conv2d: depth of input (${inputChannels}) must match ` + `input depth for filter ${$filter.shape[2]}.`);
    _util.assert(_convUtil.eitherStridesOrDilationsAreOne(strides, dilations), ()=>"Error in conv2D: Either strides or dilations must be 1. " + `Got strides ${strides} and dilations '${dilations}'`);
    const convInfo = _convUtil.computeConv2DInfo(x4D.shape, $filter.shape, strides, dilations, pad, dimRoundingMode);
    let $bias;
    if (bias != null) {
        $bias = (0, _tensorUtilEnv.convertToTensor)(bias, "bias", "fused conv2d");
        [$bias] = (0, _tensorUtil.makeTypesMatch)($bias, $x);
        // According to TensorFlow, the bias is supposed be a 1-D tensor or a
        // scalar.
        //
        // 3-D or 4-D bias is not disabled for NHWC format, because they are
        // currently being used in some cases. For examplem in our code base,
        // https://github.com/tensorflow/tfjs/blob/b53bd47e880367ae57493f0ea628abaf08db2d5d/tfjs-core/src/ops/fused/fused_conv2d_test.ts#L1972.
        if (dataFormat === "NHWC") _broadcastUtil.assertAndGetBroadcastShape(convInfo.outShape, $bias.shape);
        else {
            _util.assert($bias.shape.length <= 1, ()=>`Error in fused conv2d: only supports scalar or 1-D Tensor ` + `bias for NCHW format but got the bias of ` + `rank-${$bias.shape.length}.`);
            _util.assert($bias.shape.length === 0 || $bias.shape[0] === convInfo.outChannels || $bias.shape[0] === 1, ()=>`Error in fused conv2d: bias shape (${$bias.shape}) is not ` + `compatible with the number of output channels ` + `(${convInfo.outChannels})`);
        }
    }
    let $preluActivationWeights;
    if (preluActivationWeights != null) {
        // PReLU's activation weights could be a scalar, a 1-D tensor or a 3-D
        // tensor.
        const alphaShape = preluActivationWeights.shape;
        _util.assert(alphaShape.length <= 1 || alphaShape.length === 3, ()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or ` + `3-D Tensor PReLU activation weights but got a tensor of ` + `rank-${alphaShape.length}.`);
        if (alphaShape.length === 1) // Whether the data format is NCHW or NHWC, the 1-D PReLU activation
        // weights tensor should be aligned with the output channels of conv2d
        // result.
        _util.assert(alphaShape[0] === 1 || alphaShape[0] === convInfo.outChannels, ()=>`Error in fused conv2d: PReLU activation weights ` + `(${alphaShape}) is not compatible with the number of output ` + `channels (${convInfo.outChannels}).`);
        else if (alphaShape.length === 3) // Whether the data format is NCHW or NHWC, the PReLU activation weights
        // tensor should has the compatible shape with the result of conv2d.
        try {
            _broadcastUtil.assertAndGetBroadcastShape(alphaShape, convInfo.outShape);
        } catch (e) {
            const errMsg = `Error in fused conv2d: PReLU activation weights (${alphaShape}) ` + `is not compatible with the output shape of the conv2d ` + `(${convInfo.outShape}).`;
            throw Error(errMsg);
        }
        $preluActivationWeights = (0, _tensorUtilEnv.convertToTensor)(preluActivationWeights, "prelu weights", "fused conv2d");
    }
    const grad = (dy, saved)=>{
        _util.assert(dataFormat === "NHWC", ()=>`Error in gradient of fused conv2D: got dataFormat of ${dataFormat} but only NHWC is currently supported.`);
        const [$filter, x4D, y, $bias] = saved;
        const dyActivation = (0, _fusedUtil.getFusedDyActivation)(dy, y, activation);
        _util.assert(_convUtil.tupleValuesAreOne(dilations), ()=>"Error in gradient of fused conv2D: " + `dilation rates greater than 1 ` + `are not yet supported in gradients. Got dilations '${dilations}'`);
        const xDer = (0, _conv2DBackpropInput.conv2DBackpropInput)(x4D.shape, dyActivation, $filter, strides, pad);
        const filterDer = (0, _conv2DBackpropFilter.conv2DBackpropFilter)(x4D, dyActivation, $filter.shape, strides, pad);
        const der = [
            xDer,
            filterDer
        ];
        if ($bias != null) {
            const biasDer = (0, _fusedUtil.getFusedBiasGradient)($bias, dyActivation);
            der.push(biasDer);
        }
        return der;
    };
    const inputs = {
        x: x4D,
        filter: $filter,
        bias: $bias,
        preluActivationWeights: $preluActivationWeights
    };
    const attrs = {
        strides,
        pad,
        dataFormat,
        dilations,
        dimRoundingMode,
        activation,
        leakyreluAlpha
    };
    // Depending on the the params passed in we will have different number of
    // inputs and thus a a different number of elements in the gradient.
    if (bias == null) {
        const customOp = (0, _gradients.customGrad)((x4D, filter, save)=>{
            let res = // tslint:disable-next-line: no-unnecessary-type-assertion
            (0, _engine.ENGINE).runKernel((0, _kernelNames.FusedConv2D), inputs, attrs);
            save([
                filter,
                x4D,
                res
            ]);
            if (reshapedTo4D) // tslint:disable-next-line: no-unnecessary-type-assertion
            res = (0, _reshape.reshape)(res, [
                res.shape[1],
                res.shape[2],
                res.shape[3]
            ]);
            return {
                value: res,
                gradFunc: grad
            };
        });
        return customOp(x4D, $filter);
    } else {
        const customOpWithBias = (0, _gradients.customGrad)((x4D, filter, bias, save)=>{
            let res = (0, _engine.ENGINE).runKernel((0, _kernelNames.FusedConv2D), inputs, attrs);
            save([
                filter,
                x4D,
                res,
                bias
            ]);
            if (reshapedTo4D) // tslint:disable-next-line: no-unnecessary-type-assertion
            res = (0, _reshape.reshape)(res, [
                res.shape[1],
                res.shape[2],
                res.shape[3]
            ]);
            return {
                value: res,
                gradFunc: grad
            };
        });
        return customOpWithBias(x4D, $filter, $bias);
    }
}
Computes a 2D convolution over the input x, optionally fused with adding a
bias and applying an activation.

```js
const inputDepth = 2;
const inShape = [2, 2, 2, inputDepth];
const outputDepth = 2;
const fSize = 1;
const pad = 0;
const strides = 1;

const x = tf.tensor4d( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16], inShape);
const w = tf.tensor4d([-1, 1, -2, 0.5], [fSize, fSize, inputDepth,
outputDepth]);

tf.fused.conv2d({ x, filter: w, strides, pad, dataFormat: 'NHWC',
dilations: [1, 1], bias: tf.scalar(5), activation: 'relu' }).print();
```

@param obj An object with the following properties:
@param x The input tensor, of rank 4 or rank 3, of shape
    `[batch, height, width, inChannels]`. If rank 3, batch of 1 is
assumed.
@param filter The filter, rank 4, of shape
    `[filterHeight, filterWidth, inDepth, outDepth]`.
@param strides The strides of the convolution: `[strideHeight,
strideWidth]`.
@param pad The type of padding algorithm.
  - `same` and stride 1: output will be of same size as input,
      regardless of filter size.
  - `valid` output will be smaller than input if filter is larger
      than 1x1.
  - For more info, see this guide:
    [https://www.tensorflow.org/api_docs/python/tf/nn/convolution](
         https://www.tensorflow.org/api_docs/python/tf/nn/convolution)
@param dataFormat An optional string from: "NHWC", "NCHW". Defaults to
    "NHWC". Specify the data format of the input and output data. With the
    default format "NHWC", the data is stored in the order of: [batch,
    height, width, channels]. Only "NHWC" is currently supported.
@param dilations The dilation rates: `[dilationHeight, dilationWidth]`
    in which we sample input values across the height and width dimensions
    in atrous convolution. Defaults to `[1, 1]`. If `dilations` is a single
    number, then `dilationHeight == dilationWidth`. If it is greater than
    1, then all values of `strides` must be 1.
@param dimRoundingMode A string from: 'ceil', 'round', 'floor'. If none is
    provided, it will default to truncate.
@param bias Tensor to be added to the result.
@param activation Name of activation kernel (defaults to `linear`) to be
    applied
     after biasAdd.
@param preluActivationWeights Tensor of prelu weights to be applied as part
    of a `prelu` activation, typically the same shape as `x`.
@param leakyreluAlpha Optional. Alpha to be applied as part of a `leakyrelu`
    activation.