Hi,
From what I can see, x, y and z are not used to compute the output right? Hence the error that you’re seeing 
You can simply ask for the gradients wrt ipt and then slice that gradient to get the subset you’re interested in