coverage = None
if "coverage" in attns:
coverage = attns["coverage"][-1].unsqueeze(0)
self.update_state(dec_state, output.unsqueeze(0), coverage)
// Concatenates sequence of tensors along a new dimension.
// NOTE: v0.3 to 0.4: dec_outs / attns[*] may not be list
// (in particular in case of SRU) it was not raising error in 0.3
After Change
if not isinstance(dec_state, tuple):
dec_state = (dec_state,)
self.state["hidden"] = dec_state
self.state["input_feed"] = dec_outs[-1].unsqueeze(0)
self.state["coverage"] = None
if "coverage" in attns:
self.state["coverage"] = attns["coverage"][-1].unsqueeze(0)