31 lines
854 B
Python
31 lines
854 B
Python
"""
|
|
简单测试以找出问题
|
|
"""
|
|
|
|
import numpy as np
|
|
|
|
# 测试numpy uint64 comparison
|
|
action1 = np.uint64(676)
|
|
action2 = np.uint64(676)
|
|
action3 = 676
|
|
|
|
print(f"action1 type: {type(action1)}, value: {action1}")
|
|
print(f"action2 type: {type(action2)}, value: {action2}")
|
|
print(f"action3 type: {type(action3)}, value: {action3}")
|
|
print()
|
|
|
|
print(f"action1 == action2: {action1 == action2}")
|
|
print(f"action1 == action3: {action1 == action3}")
|
|
print(f"action2 == action3: {action2 == action3}")
|
|
print()
|
|
|
|
# 测试从array索引得到的值
|
|
valid_actions = np.array([656, 661, 666, 671, 676], dtype=np.uint64)
|
|
idx = np.argmax([0.1, 0.2, 0.3, 0.4, 0.5])
|
|
selected = valid_actions[idx]
|
|
|
|
print(f"selected type: {type(selected)}, value: {selected}")
|
|
print(f"selected == 676: {selected == 676}")
|
|
print(f"selected == np.uint64(676): {selected == np.uint64(676)}")
|
|
|