Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bupianlizhugui opened this issue Feb 2, 2021 · 0 comments
Open

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

bupianlizhugui opened this issue Feb 2, 2021 · 0 comments

Comments

@bupianlizhugui
Copy link

bupianlizhugui commented Feb 2, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant