def METHOD_NAME(self, input_param, input_data, expected_val):
    g = Rand3DElasticd(**input_param)
    g.set_random_state(123)
    if input_param.get("device", None) is None and isinstance(input_data["img"], torch.Tensor):
        input_data["img"].to("cuda:0" if torch.cuda.is_available() else "cpu")
    res = g(input_data)
    for key in res:
        result = res[key]
        expected = expected_val[key] if isinstance(expected_val, dict) else expected_val
        assert_allclose(result, expected, type_test=False, rtol=1e-2, atol=1e-2)