neon.initializers.initializer.Constant

class neon.initializers.initializer.Constant(val=0.0, name='constantInit')[source]

Bases: neon.initializers.initializer.Initializer

Initializes parameters as a constant.

__init__(val=0.0, name='constantInit')[source]

Class constructor.

Parameters:val (float, optional) – The value to assign to all tensor elements

Methods

__init__([val, name]) Class constructor.
fill(param) Fills the provided tensor.
gen_class(pdict)
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
recursive_gen(pdict, key) helper method to check whether the definition
be = None
classnm

Returns the class name.

fill(param)[source]

Fills the provided tensor.

Parameters:param (tensor) – target tensor to fill
gen_class(pdict)
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object