def generate_array(initializer, shape, xp):
 dtype = numpy.float32
 if (hasattr(initializer, 'dtype') and (initializer.dtype is not None)):
  dtype = initializer.dtype
 array = xp.empty(shape, dtype=dtype)
 initializer(array)
 return array

def generate_array ( initializer , shape , xp ) : dtype = numpy . float32 if ( hasattr ( initializer , 'dtype' ) and ( initializer . dtype is not None ) ) : dtype = initializer . dtype array = xp . empty ( shape , dtype = dtype ) initializer ( array ) return array
return initialized array .