microsoft / rat-sql

A relation-aware semantic parsing model from English to SQL
https://arxiv.org/abs/1911.04942
MIT License
406 stars 117 forks source link

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

Open bupianlizhugui opened 3 years ago

bupianlizhugui commented 3 years ago

when I run: def _debug(self, model, sliced_data, output): for i, item in enumerate(tqdm.tqdm(sliceddata)): (, 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