(self, batch, output, range_, attns)
return {
            "output": output,
            "target": batch.tgt[range_[0] + 1: range_[1]],
            "copy_attn": attns.get("copy"),
            "align": batch.alignment[range_[0] + 1: range_[1]]
        }
See base class for args description.
See base class for args description.
See base class for args description .
def _make_shard_state(self, batch, output, range_, attns):
        """ See base class for args description. """
        if getattr(batch, "alignment", None) is None:
            raise AssertionError("using -copy_attn you need to pass in "
                                 "-dynamic_dict during preprocess stage.")

        return {
            "output": output,
            "target": batch.tgt[range_[0] + 1: range_[1]],
            "copy_attn": attns.get("copy"),
            "align": batch.alignment[range_[0] + 1: range_[1]]
        }
def _make_shard_state ( self , batch , output , range_ , attns ) : if getattr ( batch , "alignment" , None ) is None : raise AssertionError ( "using -copy_attn you need to pass in " "-dynamic_dict during preprocess stage." ) return { "output" : output , "target" : batch . tgt [ range_ [ 0 ] + 1 : range_ [ 1 ] ] , "copy_attn" : attns . get ( "copy" ) , "align" : batch . alignment [ range_ [ 0 ] + 1 : range_ [ 1 ] ] }