def METHOD_NAME(val: bool):
    old_value = torchdynamo.config.optimize_ddp
    try:
        torchdynamo.config.optimize_ddp = val
        yield
    finally:
        torchdynamo.config.optimize_ddp = old_value