Skip to content

RuntimeError: index_select(): Expected dtype int64 for index #2

@cdrwolfe

Description

@cdrwolfe

Hi,

If you (i'm guessing) have a more recent version of pytorch, then it seems that the expected input for index_select has changed? from recieving a tensorflout to a tensorlong.

It basically throws up this error in beam.py line 67:

prev_attention = current_attention.index_select(dim=0, index=prev_k)

Changing '/' to '//' in line 60 of beam.py to divide and remove the integral seems to have fixed it for me in case anyone else has similar issues.

here: prev_k = top_score_ids // vocabulary_size # (beam_size, ),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions