Skip to content

Commit eeda715

Browse files
committed
update version
1 parent 5e83306 commit eeda715

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

examples/cpp/cxx_test.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,23 @@ int main()
3838

3939
// ======= opt api test =======
4040

41-
PUTPARAM(xacc.eager, false);
42-
PUTPARAM(xacc.lazy.device, "xla");
41+
PUTPARAM(a.b, false);
42+
PUTPARAM(A.B.C, "abc");
4343

44-
std::string device_type = GETPARAM(xacc.lazy.device, "xpu");
44+
std::string abc = GETPARAM(A.B.C, "123");
4545
std::cout << "\n:: (opt api) test put parameter" << std::endl
46-
<< "expected: xla" << std::endl
47-
<< "returned: " << device_type << std::endl
46+
<< "expected: abc" << std::endl
47+
<< "returned: " << abc << std::endl
4848
<< "expected: 0" << std::endl
49-
<< "returned: " << GETPARAM(xacc.eager, true) << std::endl;
49+
<< "returned: " << GETPARAM(a.b, 1) << std::endl;
5050

5151
std::cout << "\n:: (opt api) test undefined" << std::endl
5252
<< "expected: 100" << std::endl
53-
<< "returned: " << GETPARAM(xacc.dynamo.time, 100) << std::endl;
53+
<< "returned: " << GETPARAM(d.e.f, 100) << std::endl;
5454

5555
std::cout << "in main" << std::endl;
5656

57+
std::cout << "test1.test2: " << GETPARAM(test1.test2, 100) << std::endl;
58+
5759
return 0;
5860
}

examples/cpp/cxx_test.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
from hyperparameter.rbackend import KVStorage
2+
from hyperparameter import param_scope
23
import ctypes
34

45
a = ctypes.CDLL("./a.out")
5-
a.main()
6+
7+
with param_scope() as ps:
8+
ps.test1.test2 = 1
9+
a.main()
10+
11+
with param_scope():
12+
param_scope.test1.test2 = 2
13+
a.main()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "hyperparameter"
7-
version = "0.5.0"
7+
version = "0.5.1"
88
authors = [{ name = "Reiase", email = "[email protected]" }]
99
description = "A hyper-parameter library for researchers, data scientists and machine learning engineers."
1010
requires-python = ">=3.7"

0 commit comments

Comments
 (0)