docstr: Ensure that the default position ids only assign a sequential . This is a regression
  test for https://github.com/huggingface/transformers/issues/1761
  
  The position ids should be masked with the embedding object's padding index. Therefore, the
  first available non-padding position index is EsmEmbeddings.padding_idx + 1
docstr_tok: ["Ensure","that","the","default","position","ids","only","assign","a","sequential",".","This","is","a","regression","test","for","https",":","\/\/github.com\/huggingface\/transformers\/issues\/1761","The","position","ids","should","be","masked","with","the","embedding","object","'s","padding","index",".","Therefore",",","the","first","available","non-padding","position","index","is","EsmEmbeddings.padding_idx","+","1"]
code: def test_create_position_ids_respects_padding_index(self):
      """Ensure that the default position ids only assign a sequential . This is a regression
      test for https://github.com/huggingface/transformers/issues/1761
  
      The position ids should be masked with the embedding object's padding index. Therefore, the
      first available non-padding position index is EsmEmbeddings.padding_idx + 1
      """
      config = self.model_tester.prepare_config_and_inputs()[0]
      model = EsmEmbeddings(config=config)
  
      input_ids = torch.as_tensor([[12, 31, 13, model.padding_idx]])
      expected_positions = torch.as_tensor(
          [
              [
                  0 + model.padding_idx + 1,
                  1 + model.padding_idx + 1,
                  2 + model.padding_idx + 1,
                  model.padding_idx,
              ]
          ]
      )
      position_ids = create_position_ids_from_input_ids(
          input_ids, model.padding_idx
      )
      self.assertEqual(position_ids.shape, expected_positions.shape)
      self.assertTrue(
          torch.all(torch.eq(position_ids, expected_positions))
      )
  
imports: import unittest
  from transformers import EsmConfig, is_torch_available
  from transformers.testing_utils import TestCasePlus, require_torch, slow, torch_device
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
label_desc: Use image node_id 8 for calling the EsmModelTest obj's underlying member method code with example usage: obj.test_create_position_ids_respects_padding_index() without return types