def _convert_to_initializer(initializer):
 if isinstance(initializer, str):
  return getattr(tf, (initializer + '_initializer'))
 elif isinstance(initializer, np.ndarray):
  return tf.constant_initializer(initializer)
 else:
  return initializer

def _convert_to_initializer ( initializer ) : if isinstance ( initializer , str ) : return getattr ( tf , ( initializer + '_initializer' ) ) elif isinstance ( initializer , np . ndarray ) : return tf . constant_initializer ( initializer ) else : return initializer
returns a tensorflow initializer .