From 32b7d182b56015b9154f3aefc3d5c71a708ebe8f Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Fri, 10 Apr 2020 23:19:32 +0200 Subject: [PATCH] Update. --- poly.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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)) -- 2.39.5