From: Francois Fleuret Date: Fri, 10 Apr 2020 21:19:32 +0000 (+0200) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=32b7d182b56015b9154f3aefc3d5c71a708ebe8f;p=python.git Update. --- diff --git a/poly.py b/poly.py index ae9f88e..818742b 100755 --- a/poly.py +++ b/poly.py @@ -5,6 +5,8 @@ # Written by Francois Fleuret +###################################################################### + import torch def pol_prod(a, b): @@ -22,8 +24,10 @@ def pol_prim(a): n[1:] = a / n[1:] return n -a = torch.tensor([1., 2., 3.]) -b = torch.tensor([2., 5.]) +###################################################################### -print(pol_prod(a, b)) -print(pol_prim(b)) +if __name__ == '__main__': + a = torch.tensor([1., 2., 3.]) + b = torch.tensor([2., 5.]) + print(pol_prod(a, b)) + print(pol_prim(b))