Skip to content

Commit

Permalink
fix the unit test attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
allenanie committed Jul 29, 2024
1 parent f5fa7c1 commit 7173042
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/unit_tests/test_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ def user(x):
else:
return "Success."


# One-step optimization example
x = node(-1.0, trainable=True)
optimizer = OptoPrime([x], config_list=autogen.config_list_from_json("OAI_CONFIG_LIST"))
output = foobar(x)
feedback = user(output.data)
optimizer.zero_feedback()
optimizer.backward(output, feedback, visualize=True) # this is equivalent to the below line
optimizer.step(verbose=True)
if os.path.exists("OAI_CONFIG_LIST"):
# One-step optimization example
x = node(-1.0, trainable=True)
optimizer = OptoPrime([x], config_list=autogen.config_list_from_json("OAI_CONFIG_LIST"))
output = foobar(x)
feedback = user(output.data)
optimizer.zero_feedback()
optimizer.backward(output, feedback, visualize=True) # this is equivalent to the below line
optimizer.step(verbose=True)


## Test the optimizer with an example of str
Expand Down

0 comments on commit 7173042

Please sign in to comment.