解决The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()问题

时间:2022-09-05 16:07:36
def bottom_data_is(self, x, s_prev=None, h_prev=None):
    # if this is the first lstm node in the network
    if [s_prev == None]:
        s_prev = np.zeros_like(self.state.s)
    if [h_prev == None]:
        h_prev = np.zeros_like(self.state.h)
    # save data for use in backprop
    self.s_prev = s_prev
    self.h_prev = h_prev






打上括号就行