'Create additional optimizer state: momentum
Parameters
weight : NDArray
The weight data'

def create_state(self, index, weight):

    momentum = None
    weight_master_copy = None
    do_multi_precision = (self.multi_precision and (weight.dtype == np.float16))
    if do_multi_precision:
        if (self.momentum != 0.0):
            momentum = mx.nd.zeros(weight.shape, weight.context, dtype=np.float32)
        weight_master_copy = array(weight, ctx=weight.context, dtype=np.float32)
        return (momentum, weight_master_copy)
    else:
        if (self.momentum != 0.0):
            momentum = mx.nd.zeros(weight.shape, weight.context, dtype=weight.dtype)
        return momentum
