code: def _batchnorm_training_mode(x, s, bias, mean, var, momentum=0.9, epsilon=1e-5):  # type: ignore
      axis = tuple(np.delete(np.arange(len(x.shape)), 1))
      saved_mean = x.mean(axis=axis)
      saved_var = x.var(axis=axis)
      output_mean = mean * momentum + saved_mean * (1 - momentum)
      output_var = var * momentum + saved_var * (1 - momentum)
      y = _batchnorm_test_mode(
          x, s, bias, saved_mean, saved_var, epsilon=epsilon
      )
      return y.astype(np.float32), output_mean, output_var
  
file_path: onnx/onnx/backend/test/case/node/batchnorm.py
imports: import numpy
  import onnx
  from onnx.backend.test.case.base import Base
  from onnx.backend.test.case.node import expect
label_desc: Use image node_id 2 for calling a global function with example usage: _batchnorm_training_mode(x, s, bias, mean, var, momentum, epsilon) and returns: y,  output_mean,  output_var