class_docstr: Prescale batch normalization parameters.
  Concatenate gamma (scale) and beta (bias) terms if set.
class_docstr_tok: ["Prescale","batch","normalization","parameters",".","Concatenate","gamma","(","scale",")","and","beta","(","bias",")","terms","if","set","."]
code: def __call__(self, graph):
      for node in graph.nodes:
          if node.kind != NodeKind.BatchNorm:
              continue
          assert node.data is not None
          assert len(node.data) == 3
          mean, variance, scale = node.data
  
          # Prescale the stats
          scaling_factor = 1.0 / scale if scale != 0 else 0
  
          if len(np.squeeze(mean) == 1):
              mean = np.squeeze(mean)
              variance = np.squeeze(variance)
              scaling_factor = np.squeeze(scaling_factor)
  
          mean *= scaling_factor
          variance *= scaling_factor
  
          # Replace with the updated values
          node.data = [mean, variance]
          if hasattr(node, "scale_bias_node"):
              # Include the scale and bias terms
              gamma, beta = node.scale_bias_node.data
              node.data += [gamma, beta]
      return graph
  
imports: from __future__ import unicode_literals
  from google.protobuf import text_format
  import numpy
  from mmdnn.conversion.caffe.graph import GraphBuilder, NodeKind, LAYER_IN_TRAIN_PROTO
  from mmdnn.conversion.caffe.mapper import NodeMapper, get_handler_name
  from mmdnn.conversion.caffe.resolver import get_caffe_resolver, has_pycaffe
  from mmdnn.conversion.caffe.errors import print_stderr, ConversionError
  from mmdnn.conversion.caffe.common_graph import Graph
  from mmdnn.conversion.caffe.utils import get_lower_case, get_upper_case
label_desc: Use image node_id 1 for calling the BatchNormPreprocessor obj's underlying member method code with example usage: obj.__call__(graph) and returns: graph