neon.initializers.initializer.Array

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

Bases: neon.initializers.initializer.Constant

Initializes parameters with values specified by a provided numpy array.

Same functionality as Constant except serialization needs to dump tensor values into np array

Parameters:vals (ndarray or tensor, optional) – Values to assign to the tensor elements
__init__(val=0.0, name='constantInit')

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() Returns description of the object as a dict.
recursive_gen(pdict, key) helper method to check whether the definition

Attributes

be
classnm Returns the class name.
modulenm Returns the full module path.
be = None
classnm

Returns the class name.

fill(param)

Fills the provided tensor.

Parameters:param (tensor) – target tensor to fill
gen_class(pdict)
get_description()[source]

Returns description of the object as a dict. Transfers the tensors back to a numpy array.

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