def METHOD_NAME(self, device, dtype, op):
    self._skip_helper(op, device, dtype)
    if not op.inplace_variant:
        self.skipTest("Op has no inplace variant!")
    # Verifies an operation doesn't support inplace autograd if it claims not to
    if not op.supports_inplace_autograd:
        inplace = self._get_safe_inplace(op.get_inplace())
        for sample in op.sample_inputs(device, dtype, requires_grad=True):
            if sample.broadcasts_input:
                continue
            with self.assertRaises(Exception):
                result = inplace(sample)
                result.sum().backward()
    else:
        self._grad_test_helper(device, dtype, op, self._get_safe_inplace(op.get_inplace()))