LeeSureman / Batch_Parallel_LatticeLSTM

Chinese NER using Lattice LSTM. Reproduction for ACL 2018 paper.
129 stars 16 forks source link

请教一个代码的问题 #22

Open mahatmaWM opened 4 years ago

mahatmaWM commented 4 years ago
            if not self.skip_before_head:
                c_x = c_[[index_0, index_1 + 1]]
                h_x = h_[[index_0, index_1 + 1]]
            else:
                c_x = c_[[index_0, index_1]]
                h_x = h_[[index_0, index_1]]

请教一下作者,https://github.com/LeeSureman/Batch_Parallel_LatticeLSTM/blob/master/modules.py 里面的420那几行,是什么意思?[里面也是二维tensor] 看官方doc没有看到这样获取元素的例子,麻烦作者告知,或者有例子链接推荐一下,谢谢!

LeeSureman commented 4 years ago

https://blog.csdn.net/SHU15121856/article/details/87810372 可以看下这个

Feng-hue commented 2 years ago
            if not self.skip_before_head:
                c_x = c_[[index_0, index_1 + 1]]
                h_x = h_[[index_0, index_1 + 1]]
            else:
                c_x = c_[[index_0, index_1]]
                h_x = h_[[index_0, index_1]]

请教一下作者,https://github.com/LeeSureman/Batch_Parallel_LatticeLSTM/blob/master/modules.py 里面的420那几行,是什么意思?[里面也是二维tensor] 看官方doc没有看到这样获取元素的例子,麻烦作者告知,或者有例子链接推荐一下,谢谢! 你好,请问你理解了吗?能分享下吗?谢谢