code: def compute_fan(self, shape):
      if len(shape) == 2:
          fan_in = shape[0]
          fan_out = shape[1]
      elif len(shape) in {3, 4, 5}:
          fan_in = shape[1] * np.prod(shape[2:])
          fan_out = shape[0] * np.prod(shape[2:])
      else:
          fan_in = fan_out = np.sqrt(np.prod(shape))
  
      return fan_in, fan_out
  
file_path: singa/test/python/test_initializer.py
imports: from singa import initializer
  from singa import tensor
  from singa import singa_wrap
  from cuda_helper import gpu_dev, cpu_dev
  import unittest
  import numpy
label_desc: Use image node_id 2 for calling the TestInitializer obj's underlying member method code with example usage: obj.compute_fan(shape) and returns: fan_in,  fan_out