API

 torch / nn / torch.nn


torch.nn.utils.parameters_to_vector

torch.nn.utils.parameters_to_vector(parameters: Iterable[torch.Tensor]) → torch.Tensor[source]

Convert parameters to one vector

Parameters

parameters (Iterable[Tensor]) – an iterator of Tensors that are the parameters of a model.

Returns

The parameters represented by a single vector


此页内容是否对您有帮助