How do I create neighborhood embeddings in pytorch?

How do I create neighborhood embeddings in pytorch?There are embeddings, but how should I express neighborhood embeddings?