[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Collects the mean value and variance of data on all devices and updates the global mean value and variance.

  • Formula:

    batchMean=i=0NtotalSum[i]i=0NsampleCount[i]batchMean = \frac{\sum^N_{i=0}{totalSum[i]}}{\sum^N_{i=0}{sampleCount[i]}} batchVar=i=0NtotalSquareSum[i]i=0NsampleCount[i]batchMean2batchVar = \frac{\sum^N_{i=0}{totalSquareSum[i]}}{\sum^N_{i=0}{sampleCount[i]}} - batchMean^2 batchInvstd=1batchVar+εbatchInvstd = \frac{1}{\sqrt{batchVar + ε}} runningMean=runningMean(1momentum)+momentumbatchMeanrunningMean = runningMean*(1-momentum) + momentum*batchMean runningVar=runningVar(1momentum)+momentum(batchVari=0NsampleCount[i]i=0NsampleCount[i]1)runningVar = runningVar*(1-momentum) + momentum*(batchVar* \frac{\sum^N_{i=0} {sampleCount[i]}}{\sum^N_{i=0}{sampleCount[i]}-1})
[object Object]

Each operator has calls. First, aclnnSyncBatchNormGatherStatsGetWorkspaceSize is called to obtain the input parameters and to compute the workspace size required for computation. Then, aclnnSyncBatchNormGatherStats is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas A3 training products/Atlas A3 inference products[object Object] and [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: The data type of [object Object], [object Object], [object Object], [object Object], [object Object] and [object Object] cannot be BFLOAT16.
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnSyncBatchNormGatherStats defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]