'Initializes parameter and gradient arrays. Only used for `NDArray` API.
Parameters
init : Initializer
The initializer to use. Overrides `Parameter.init` and default_init.
ctx : Context or list of Context, defaults to `context.current_context()`.
Initialize Parameter on given context. If ctx is a list of Context, a
copy will be made for each context.
.. note:: Copies are independent arrays. User is responsible for keeping
their values consistent when updating. Normally `gluon.Trainer` does this for you.
default_init : Initializer
Default initializer is used when both `init` and `Parameter.init` are `None`.
force_reinit : bool, default False
Whether to force re-initialization if parameter is already initialized.
Examples
>>> weight = mx.gluon.Parameter(\'weight\', shape=(2, 2))
>>> weight.initialize(ctx=mx.cpu(0))
>>> weight.data()
[[-0.01068833  0.01729892]
[ 0.02042518 -0.01618656]]
<NDArray 2x2 @cpu(0)>
>>> weight.grad()
[[ 0.  0.]
[ 0.  0.]]
<NDArray 2x2 @cpu(0)>
>>> weight.initialize(ctx=[mx.gpu(0), mx.gpu(1)])
>>> weight.data(mx.gpu(0))
[[-0.00873779 -0.02834515]
[ 0.05484822 -0.06206018]]
<NDArray 2x2 @gpu(0)>
>>> weight.data(mx.gpu(1))
[[-0.00873779 -0.02834515]
[ 0.05484822 -0.06206018]]
<NDArray 2x2 @gpu(1)>'

def initialize(self, init=None, ctx=None, default_init=initializer.Uniform(), force_reinit=False):

    if ((self._data is not None) and (not force_reinit)):
        warnings.warn(('Parameter    %s    is    already    initialized,    ignoring.    Set    force_reinit=True    to    re-initialize.' % self.name))
        return
    self._data = self._grad = None
    if (ctx is None):
        ctx = [context.current_context()]
    if isinstance(ctx, Context):
        ctx = [ctx]
    if (init is None):
        init = (default_init if (self.init is None) else self.init)
    if ((not self.shape) or (np.prod(self.shape) <= 0)):
        if self.allow_deferred_init:
            self._deferred_init = (init, ctx, default_init)
            return
        raise ValueError(('Cannot    initialize    Parameter    %s    because    it    has    invalid    shape:    %s.' % (self.name, str(self.shape))))
    self._deferred_init = (init, ctx, default_init)
    self._finish_deferred_init()
