Platforms: linux

This test was disabled because it is failing on master ([recent examples](http://torch-ci.com/failure/test_torch.py%3A%3ATestTorch%3A%3Atest_equal)).

The cause seems to point to https://github.com/pytorch/pytorch/pull/100024 (or D45282119 as it was landed internally)

cc @mruberry @houseroad @ezyang 
ref_out = ref_out.to(d=d)
            out = tensor.index_add(dim, index, source)
            if d == 'cuda':
                self.assertEqual(out, ref_out, atol=1e-2, rtol=1e-2)
            else:
                self.assertEqual(out, ref_out.to(d=d))
        for dim in [-1, -2, -3]:
            for d in all_s_and_complex_and(torch.half, torch.bfloat16):
                for d in get_all_d_s():
                    for size in [(2, 512, 256), (5, 256, 256)]:
                        helper(dim, d, d, size, size)
                
                size_result = (2, 512, 256)
                size_source = (1, 512, 256)
                helper(dim, d, 'cpu', size_result, size_source)
                size_result = (2, 512, 512)
                size_source = (1, 512, 1)
                helper(dim, d, 'cpu', size_result, size_source)
                size_result = (2, 512, 256)
                size_source = (2, 1, 256)
                helper(dim, d, 'cpu', size_result, size_source)
                
                result = torch.zeros(1, 512, 256, d=d)
                source = torch.ones(1, 512, 256, d=d)
                index = torch.ones(257).to(d=torch.long)
                self.assertRaises(RuntimeError, lambda: result.index_add_(dim, index, source))
                index = (torch.ones(256) * 257).to(d=torch.long)
                self.assertRaises(RuntimeError, lambda: result.index_add_(dim, index, source))
    
    def test_unflatten(self):