encoderfile 0.6.2

Distribute and run transformer encoders with a single file.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
---Generated by Encoderfile ❤️
---Remember: Lua is 1-indexed!

---Postprocess embeddings
---Must return 2D tensor of shape [batch_size, *]
---@input Tensor 3D tensor of shape [batch_size, seq_len, hidden_dim]
---@input mask Attention mask of shape [batch_size, seq_len]
---@return Tensor
function Postprocess(arr, mask)
    ---Replace with your logic here
    return arr:mean_pool(mask)
end