I have a tensor R containing distances to the center position and a parameter r_max defining the maximum distance. I want to generate a mask like R.lt(r_max) and get the gradient wrt r_max. How should I generate the mask tensor to make this possible? I tried lt() and torch.where()and both failed.