Skip to content

Commit 91e2b0f

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
deeplearning/projects/flashlight-sequence
Reviewed By: zsol Differential Revision: D53083529 fbshipit-source-id: d834e9535aba755da0df1167ffb19b59ca8e9933
1 parent e438317 commit 91e2b0f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bindings/python/example/criterion_example.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from flashlight.lib.sequence.criterion import ASGLoss, CriterionScaleMode
1313

1414

15-
if __name__ == "__main__":
15+
def main() -> None:
1616
parser = argparse.ArgumentParser()
1717
parser.add_argument(
1818
"--cpu", action="store_true", help="Use cpu backend, otherwise use CUDA backend"
@@ -80,3 +80,7 @@
8080
loss.backward(grad)
8181
print("Gradients with respect to the ASG loss input", input.grad)
8282
print("Gradients with respect to the transition matrix", asg.transitions.grad)
83+
84+
85+
if __name__ == "__main__":
86+
main() # pragma: no cover

0 commit comments

Comments
 (0)