File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,12 @@ def continue_annotation():
3030 return _annotation_enabled
3131
3232
33- class set_working_tape ( ContextDecorator ) :
33+ class set_working_tape :
3434 """Set a new tape as the working tape.
3535
3636 This class can be used in three ways:
3737 1) as a free function to replace the working tape,
3838 2) as a context manager within which a new tape is set as the working tape,
39- 3) as a function decorator so that the new tape is set only inside the function.
4039
4140 Example usage:
4241
@@ -55,22 +54,6 @@ class set_working_tape(ContextDecorator):
5554 with set_working_tape() as tape:
5655 ...
5756
58- 3) Set the local tape inside a decorated function.
59- The two functions below are equivalent:
60-
61- .. highlight:: python
62- .. code-block:: python
63-
64- @set_working_tape()
65- def decorated_function(*args, **kwargs):
66- # do something here
67- return ReducedFunctional(functional, control)
68-
69- def context_function(*args, **kwargs):
70- with set_working_tape():
71- # do something here
72- return ReducedFunctional(functional, control)
73-
7457 """
7558
7659 def __init__ (self , tape = None , ** tape_kwargs ):
You can’t perform that action at this time.
0 commit comments