SimonW:

k = A.size(0)
A.as_strided([k], [k + 1]).copy_(vector)


@SimonW I’m getting the error “AttributeError: ‘Variable’ object has no attribute ‘as_strided’” although I have the latest PyTorch version. What is the problem?