I want to optimize a loss with respect to specific dimentions of parameter.
I have a parameter z to optimize, but with respect to certain part of it and want to fix other parts. like this
optimizer = torch.optim.Adam(params=[z[:, start:end]], lr=0.01)

but this code gets
ValueError: can’t optimize a non-leaf Tensor
How can I do it?