Hayato Maki
Hayato Maki

Reputation: 53

Where is the definition of torch.embedding in PyTorch?

I'm trying to understand how PyTorch creates embeddings and read the source code of torch.nn.functional.embedding github link. The function returns the result of torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse). Then, I try to understand the definition of torch.embedding but I can't find its source code in the GitHub repository. Where is it?

Upvotes: 5

Views: 1985

Answers (1)

jodag
jodag

Reputation: 22224

Many of PyTorch's functions are implemented in C++. The entrypoint for torch.embedding is located here.

Upvotes: 5

Related Questions