def before(x, y): return stop_gradient(x) + stop_gradient(y)
def test_prim_stop_gradient(): for x in (1, 1.7, True, False, [1, 2, 3], (4, 5)): assert stop_gradient(x) is x