Here’s a minimal example:
import torch as th
from torch.autograd import Variable

v1 = Variable(th.randn(10), requires_grad=True)
m = v1 > 0.5
w = v1[m]

w.mean().backward()

This raises a NotImplementedError:
Traceback (most recent call last):
  File "/home/nrahaman/.PyCharm2016.1/config/scratches/scratch_100.py", line 10, in <module>
    w.mean().backward()
  File "/home/nrahaman/miniconda2/envs/thtf/lib/python3.6/site-packages/torch/autograd/variable.py", line 146, in backward
    self._execution_engine.run_backward((self,), (gradient,), retain_variables)
  File "/home/nrahaman/miniconda2/envs/thtf/lib/python3.6/site-packages/torch/autograd/function.py", line 137, in backward
    raise NotImplementedError
NotImplementedError

This can be worked around with gather and arange, but I’m still curious if it’s a me-problem.