Starting backward from any convolutional layer

The backward function starts the gradient operation from the output respect to the input.
How can I compute gradient from specific convolution layer in specific layer, instead from output, respect to input?Is there any solution in Pytorch or should I create my own backward function?

Thanks you in advance.