rat-sql icon indicating copy to clipboard operation
rat-sql copied to clipboard

add() argument 'other' must be tensor, not tuple

Open bupianlizhugui opened this issue 4 years ago • 0 comments

when I run: def debug(self, model, sliced_data, output): for i, item in enumerate(tqdm.tqdm(sliced_data)): (, history), = model.compute_loss([item], debug=True) output.write( json.dumps({ 'index': i, 'history': history, }) + '\n') output.flush()

def compute_loss(self, enc_input, example, desc_enc, debug):
    if not (self.enumerate_order and self.training):
        mle_loss = self.compute_mle_loss(enc_input, example, desc_enc, debug)
    else:
        mle_loss = self.compute_loss_from_all_ordering(enc_input, example, desc_enc, debug)

    if self.use_align_loss:
        align_loss = self.compute_align_loss(desc_enc, example)
        **return mle_loss + align_loss**
    return mle_loss

This error appeared.I don't know how to fix it

bupianlizhugui avatar Feb 02 '21 02:02 bupianlizhugui