class_docstr: A constant parameter for holding immutable tensors.
  `Constant`s are ignored by `autograd` and `Trainer`, thus their values
  will not change during training. But you can still update their values
  manually with the `set_data` method.
  
  `Constant` s can be created with either::
  
      const = mx.gluon.Constant([[1,2],[3,4]])
  
  or::
  
      class Block(gluon.Block):
          def __init__(self, **kwargs):
              super(Block, self).__init__(**kwargs)
              self.const = mx.gluon.Constant([[1,2],[3,4]])
  
  Parameters
  ----------
  value : array-like
      Initial value for the constant.
class_docstr_tok: ["A","constant","parameter","for","holding","immutable","tensors",".","`","Constant","`","s","are","ignored","by","`","autograd","`","and","`","Trainer","`",",","thus","their","values","will","not","change","during","training",".","But","you","can","still","update","their","values","manually","with","the","`","set_data","`","method",".","`","Constant","`","s","can","be","created","with","either",":",":","const","=","mx.gluon.Constant","(","[","[","1,2","]",",","[","3,4","]","]",")","or",":",":","class","Block","(","gluon.Block",")",":","def","__init__","(","self",",","*","*","kwargs",")",":","super","(","Block",",","self",")",".__init__","(","*","*","kwargs",")","self.const","=","mx.gluon.Constant","(","[","[","1,2","]",",","[","3,4","]","]",")","Parameters","--","--","--","--","--","value",":","array-like","Initial","value","for","the","constant","."]
code: def __init__(self, value):
      if not isinstance(value, ndarray.NDArray):
          array_fn = _mx_np.array if is_np_array() else ndarray.array
          value = array_fn(value)
      self.value = value
  
      class Init(initializer.Initializer):
          def _init_weight(self, _, arr):
              value.copyto(arr)
  
      init_name = "Constant_{}".format(id(self))
      initializer.alias(init_name)(Init)
  
      super(Constant, self).__init__(
          name="const",
          grad_req="null",
          shape=value.shape,
          dtype=value.dtype,
          init=init_name,
      )
  
imports: import uuid
  import warnings
  import weakref
  import numpy
  from ..base import mx_real_t, MXNetError
  from ..None import symbol, ndarray, initializer, device, _deferred_compute
  from ..device import Device, cpu
  from ..None import autograd
  from .utils import shape_is_known
  from ..util import is_np_shape, is_np_array, wrap_ctx_to_device_func
  from ..None import numpy
label_desc: Use image node_id 1 to create a new Constant object from inherited base classes: Parameter with example: obj = Constant(value)