code: def default_w_initializer():
      def _initializer(shape, dtype, partition_info):
          stddev = np.sqrt(2.0 / np.prod(shape[:-1]))
          from tensorflow.python.ops import random_ops
  
          return random_ops.truncated_normal(
              shape, 0.0, stddev, dtype=tf.float32
          )
          # return tf.truncated_normal_initializer(
          #    mean=0.0, stddev=stddev, dtype=tf.float32)
  
      return _initializer
  
imports: from __future__ import absolute_import, print_function
  import math
  import numpy
  import tensorflow
  from niftynet.layer import layer_util
  from niftynet.layer.activation import ActiLayer
  from niftynet.layer.base_layer import TrainableLayer
  from niftynet.layer.bn import BNLayer, InstanceNormLayer
  from niftynet.layer.gn import GNLayer
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 1 for calling a global function with example usage: default_w_initializer() and returns: _initializer, random_ops