AI4C/0001-Bugfix-for-undefined-np-symbol-in-ai4c-option-tuner.patch

39 lines
1.3 KiB
Diff
Raw Normal View History

From cce36baee7dc03d59355c1359e3653f4d695bc1a Mon Sep 17 00:00:00 2001
From: liuf9 <liufeiyang6@huawei.com>
Date: Sun, 8 Dec 2024 15:14:25 +0800
Subject: [PATCH] Bugfix for undefined "np" symbol in ai4c-option-tuner.
---
python/ai4c/option_tuner/xgboost_cost_model.py | 2 +-
python/test/option_tuner/run_option_tuner.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/ai4c/option_tuner/xgboost_cost_model.py b/python/ai4c/option_tuner/xgboost_cost_model.py
index 06c3bea5..5f779c9d 100644
--- a/python/ai4c/option_tuner/xgboost_cost_model.py
+++ b/python/ai4c/option_tuner/xgboost_cost_model.py
@@ -25,7 +25,7 @@ class XGBoostCostModel(object):
def predict(self, xs: List[List[int]]):
ret = []
for x in xs:
- ret.append(self.bst.predict(np.asarray([x]))[0])
+ ret.append(self.bst.predict(asarray([x]))[0])
return ret
diff --git a/python/test/option_tuner/run_option_tuner.sh b/python/test/option_tuner/run_option_tuner.sh
index baf00480..f36dcb5f 100644
--- a/python/test/option_tuner/run_option_tuner.sh
+++ b/python/test/option_tuner/run_option_tuner.sh
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
-ai4c-option-tune --test_limit 3 -r run_test.sh
+ai4c-option-tune --test_limit 20 -r run_test.sh
### clean intermediate files ###
if [ "$1" = "clean" ]; then
--
2.33.0