I guess tokenizer.encode_plus has some problem. Can you show the output of
1)
tokenizer.encode_plus(text="I am in pytorch", 
                                         max_length=50,
                                         add_special_tokens=True, padding='max_length', 
                                         return_attention_mask=True, 
                                         return_token_type_ids=False, return_tensors='pt')

and
2)
tokenizer.encode_plus(text="I am not in pytorch", 
                                         max_length=50,
                                         add_special_tokens=True, padding='max_length', 
                                         return_attention_mask=True, 
                                         return_token_type_ids=False, return_tensors='pt')