W3cubDocs

/PyTorch 2.9

torch.nn.utils.convert_parameters.parameters_to_vector

torch.nn.utils.convert_parameters.parameters_to_vector(parameters) [source]

Flatten an iterable of parameters into a single vector.

Parameters

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

Returns

The parameters represented by a single vector

Return type

Tensor

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.nn.utils.convert_parameters.parameters_to_vector.html