Shortcuts

torch.nn.utils.parameters_to_vector

torch.nn.utils.parameters_to_vector(parameters)[source][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

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources