I’m getting the following error when I run your code:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-429aeef1b570> in <module>()
     37 d = torch.rand(1,5, requires_grad=True)
     38 o = m(d, d+1)
---> 39 o.backward()
     40 print(d.grad)

/usr/local/lib/python2.7/dist-packages/torch/tensor.pyc in backward(self, gradient, retain_graph, create_graph)
     91                 products. Defaults to ``False``.
     92         """
---> 93         torch.autograd.backward(self, gradient, retain_graph, create_graph)
     94 
     95     def register_hook(self, hook):

/usr/local/lib/python2.7/dist-packages/torch/autograd/__init__.pyc in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables)
     88     Variable._execution_engine.run_backward(
     89         tensors, grad_tensors, retain_graph, create_graph,
---> 90         allow_unreachable=True)  # allow_unreachable flag
     91 
     92 

RuntimeError: the derivative for 'symeig' is not implemented

I thought it may be a problem with my PyTorch version but I have just upgrade it. My current version is 0.4.1.