Just an update on this, there’s now torch.testing which you can use similarly to numpy.testing;
In [8]: x = torch.ones(1)
In [9]: y = x+1
In [10]: torch.testing.assert_allclose(x,y)
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-10-3b698e9eddbf> in <module>()
----> 1 torch.testing.assert_allclose(x,y)

/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/testing/__init__.py in assert_allclose(actual, expected, rtol, atol, equal_nan)
     55     raise AssertionError(msg.format(
     56         rtol, atol, list(index), actual[index].item(), expected[index].item(),
---> 57         count - 1, 100 * count / actual.numel()))
     58 
     59 

AssertionError: Not within tolerance rtol=0.0001 atol=1e-05 at input[0] (1.0 vs. 2.0) and 0 other locations (100.00%)