def METHOD_NAME(self, test_case: STThresholdTestCase, use_cuda: bool, requires_grad: bool):
    device = torch.device("cuda" if use_cuda else "cpu")
    input_tensor = test_case.input_tensor.clone().to(device).requires_grad_(requires_grad)
    output_tensor = STThreshold.apply(input_tensor, test_case.threshold)
    ref_output_tensor = test_case.ref_output_tensor.clone().to(device)
    assert output_tensor.device == input_tensor.device
    assert output_tensor.requires_grad is requires_grad
    assert torch.allclose(output_tensor, ref_output_tensor)
    if requires_grad:
        assert output_tensor.grad_fn.name().startswith("STThresholdBackward")
        output_tensor.sum().backward()
        ref_grad_tensor = torch.ones_like(input_tensor)
        assert torch.allclose(input_tensor.grad, ref_grad_tensor)