Sample Usage

Overview

This sample implements the BatchNorm operator in TIK mode and supports operator execution in the dynamic shape scenario.

The BatchNorm operator normalizes the input. xnorm = (x−μ)/σ, where μ and σ are the calculated average value and variance, respectively.

Sample Obtaining

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample of TIK dynamic-shape operator development in the samples/cplusplus/level1_single_api/4_op_dev/4_other/singleop/tbe/impl directory.

Go to the Ascend samples repository on Gitee or GitHub and download the sample package that matches the required version. For the version mapping, see "Release Notes" in the README file. Find the sample of TIK dynamic-shape operator verification in the samples/cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_batchnorm directory.

Operator Building

Refer to the readme file in the samples/cplusplus/level1_single_api/4_op_dev/4_other/singleop/tbe/impl directory.

Operator Execution on Ascend EP Host

Build the BatchNorm operator project to generate a single-operator verification executable, and run the executable file. For details, see the readme file in the samples/cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_batchnorm directory.