Because you want to go into numpy and back, the backward function might have to be marked with:
@staticmethod 
@once_differentiable

If you dont do once_differentiable, the input to backward is Variables and not Tensors.
Variables dont have .numpy() defined on them. If x is a Variable, then x.data.numpy() will exist instead.