einsum

Understanding fancy einsum equation

Understanding fancy einsum equation Question: I was reading about attention and came across this equation: import einops from fancy_einsum import einsum import torch x = torch.rand((200, 10, 768)) y = torch.rand((20, 768, 64)) res = einsum("batch query_pos d_model, n_heads d_model d_head -> batch query_pos n_heads d_head", x, y) And I am not able to understand …

Total answers: 1