Created by: zhouxiao-coder
Solve #5811 (closed)
As part of the job of another PR #5686 , I separate the code that related to batch_norm_op enhancement as a standalone PR for better code review.
This PR does several modifications to the original batch_norm_op implementation.
-
Extract normalization logic to a common header file, check issue #5685 (closed) for disscussion.
-
Fix assertion logic. Some outputs should appear only in training mode.
-
Support unbiased variance estimation, i.e. the bessel's correction.
-
Support 2D tensor (tensor_format="NC") and 5D tensor (tensor_format="NCDHW" or "NDHWC") in CPU
-
Support 2D tensor (tensor_format="NC") and 5D tensor (tensor_format="NCDHW" or "NDHWC") in GPU.
-
Operator unit test. See issue #5842 (closed) .
2D tensor is not supported by cudnn batch norm implementation, so changes need to be made to the GPU code.