mindspore.ParameterTuple

class mindspore.ParameterTuple[source]

Inherited from tuple, ParameterTuple is used to save multiple parameter.

Note

It is used to store the parameters of the network into the parameter tuple collection.

clone(prefix, init='same')[source]

Clone the parameters in ParameterTuple element-wisely to generate a new ParameterTuple.

Parameters
  • prefix (str) – Namespace of parameter, the prefix string will be added to the names of parameters in parametertuple.

  • init (Union[Tensor, str, numbers.Number]) –

    Clone the shape and dtype of Parameters in ParameterTuple and set data according to init. Default: ‘same’.

    • If init is a Tensor , set the new Parameter data to the input Tensor.

    • If init is numbers.Number , set the new Parameter data to the input number.

    • If init is a str, data will be seted according to the initialization method of the same name in the Initializer.

    • If init is ‘same’, the new Parameter has the same value with the original Parameter.

Returns

Tuple, the new Parameter tuple.