# Constant¶

class mxnet.gluon.Constant(name, value)[source]

A constant parameter for holding immutable tensors. Constants 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.

Constants can be created with either:

const = mx.gluon.Constant('const', [[1,2],[3,4]])


or:

class Block(gluon.Block):
def __init__(self, **kwargs):
super(Block, self).__init__(**kwargs)
self.const = self.params.get_constant('const', [[1,2],[3,4]])

Parameters: name (str) – Name of the parameter. value (array-like) – Initial value for the constant.