From f5f8b51f2858d2c87b9a9e155fadebdce3723448 Mon Sep 17 00:00:00 2001 From: zhang Date: Sat, 9 Apr 2022 18:42:41 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nlp/demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nlp') diff --git a/nlp/demo.py b/nlp/demo.py index 9eb7154..1b15a71 100644 --- a/nlp/demo.py +++ b/nlp/demo.py @@ -4,8 +4,8 @@ import numpy as np def test1(): fun = lambda x: x**2 + 2*x - 3 - x0 = 1 - res = minimize(fun, [x0], bounds=[[0, None]], ) + x0 = np.asarray(1) + res = minimize(fun, x0, bounds=[[0, None]], ) print(res) -- cgit v1.2.3