由于 Theano 的 scan 函数内部检查是否在多个地方使用了相同类型的变量,我收到了一个错误。此函数不允许(N, 1)
col TensorType 的 a 与(N, 1)
矩阵交换(请参阅下面的错误)。
如何将 TensorType 的张量转换/转换为(N, 1)
TensorType ?col
matrix
TypeError: ('The following error happened while compiling the node', forall_inplace,cpu,scan_fn}(TensorConstant{20}, InplaceDimShuffle{1,0,2}.0, IncSubtensor{InplaceSet;:int64:}.0, IncSubtensor{InplaceSet;:int64:}.0, IncSubtensor{InplaceSet;:int64:}.0, TensorConstant{20}, condpred_1_W_ih, condpred_1_W_ho, embedding_1_W, InplaceDimShuffle{x,0}.0, InplaceDimShuffle{x,0}.0, AdvancedIncSubtensor{inplace=False, set_instead_of_inc=True}.0), '\n', "Inconsistency in the inner graph of scan 'scan_fn' : an input and an output are associated with the same recurrent state and should have the same type but have type 'TensorType(int32, matrix)' and 'TensorType(int32, col)' respectively.")