根據(jù)PyTorch 官方文檔的更新說明,從PyTorch 2.4版本開始,torch.cuda.amp模塊中的部分 API 已被標記為棄用(deprecated)。為了統(tǒng)一 API 的設(shè)計風(fēng)格,并支持更多的后端設(shè)備(如 CPU 和其他加速器)。 雖然目前這些警告并不會導(dǎo)致程序報錯,但官方建議開發(fā)者盡快調(diào)整代碼以適配最新版本的規(guī)范。 解決方法 1: 適配新 API 替換...
cell=tf.contrib.rnn.MultiRNNCell([single_cell()for_inrange(num_layers)]) # The seq2seq function: we use embedding for the input and attention. defseq2seq_f(encoder_inputs, decoder_inputs, do_decode): returntf.contrib.legacy_seq2seq.embedding_attention_seq2seq( ...