Another way to express masked_index = torch.nonzero(input_ids == self.tokenizer.mask_token_id, as_tuple=False)
Dear,

We use PyTorch 1.1.0 to run a masked word completion with BERT. However, we found an error
`TypeError: nonzero() got an unexpected keyword argument 'as_tuple'`

The error refers to this:
`masked_index = torch.nonzero(input_ids == self.tokenizer.mask_token_id, as_tuple=False)`

Is there another way to express the syntax above with keep using PyTorch 1.1.0?

Best regards,

Mohammad YANI


Hello! Unfortunately, recent transformers versions only work with torch 1.4.0+. The README is incorrect respective to that, and I'll update it in the coming days.<|||||>> Hello! Unfortunately, recent transformers versions only work with torch 1.4.0+. The README is incorrect respective to that, and I'll update it in the coming days.

Thank you for the response.

Okay. Does it mean that there is no another way for expressing `masked_index = torch.nonzero(input_ids == self.tokenizer.mask_token_id, as_tuple=False)` in pytorch 1.1.0? Is it still possible to use `torch.where(...)`? if yes, how to express it with `torch.where()`?

This is because the available machine we used is in an old driver version of CUDA.

Sincerely,
MY<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.