The latter is easier for IDEs to keep track of the attribute’s
name (str) – Name of the parameter. This name is also used as the
shape (int or tuple of ints) – Shape of the parameter array. If it
is omitted, the parameter variable is left uninitialized.
dtype – Data type of the parameter array.
initializer – If it is not None, the data is initialized with
the given initializer. If it is an array, the data is directly
initialized by it. If it is callable, it is used as a weight
initializer. Note that in these cases, dtype argument is
The whole hierarchy rooted by this link is copied. The copy is
basically shallow, except that the parameter variables are also
shallowly copied. It means that the parameter variables of copied one
are different from ones of original link, while they share the data and
The name of the link is reset on the copy, since the copied instance
does not belong to the original parent chain (even if exists).
This method returns a context manager object that enables registration
of parameters (and links for Chain) by an assignment.
A Parameter object can be automatically registered
by assigning it to an attribute under this context manager.
In most cases, the parameter registration is done in the
initializer method. Using the init_scope method, we can
simply assign a Parameter object to register
it to the link.
Registers an attribute of a given name as a persistent value.
This is a convenient method to register an existing attribute as a
persistent value. If name has been already registered as a
parameter, this method removes it from the list of parameter names
and re-registers it as a persistent value.
name (str) – Name of the attribute to be registered.