我应该如何修正这个错误?
dhidden[hidden <= 0] = 0
给我一个错误:
IndexError: boolean index did not match indexed array along dimension 1; dimension is 3 but corresponding boolean dimension is 10
更多信息:
print(type(hidden))
<class 'numpy.ndarray'>
print(type(hidden))
<class 'numpy.ndarray'>
print(dhidden.shape)
(5, 3)
print(hidden.shape)
(5, 10)
hidden.dtype和dhidden.dtype是float64
我尝试了dhidden[hidden<;=0.0]=0.0,仍然得到相同的错误。
目前没有回答
相关问题 更多 >
编程相关推荐