This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Description
Hi,
When I used vmap to compute per-sample-gradient for the network with following lines which use part of the features as output:
x = x[:,:,::2,::2]
or
y = self.convs(y[:, :, 1:, 1:])
I have encountered the following error:
RuntimeError: vmap: aten::copy_(self, *extra_args) is not possible because there exists a Tensor 'other' in extra_args that has more elements than 'self'. This happened due to 'other' being vmapped over but 'self' not being vmapped over. Please try to use out-of-place operators instead of aten::copy_. If said operator is being called inside the PyTorch framework, please file a bug report instead.
I am wondering if functorch can support such operations.
Thanks!