Working on low-latency/low-resource AI
Neuroscience wannabe
https://botcs.github.io/
if the max(K):T ratio is low then I guess it worths 1) gathering into an intermediate tensor 2) shuffling the values 3) scattering to x`.
if the max(K):T ratio is low then I guess it worths 1) gathering into an intermediate tensor 2) shuffling the values 3) scattering to x`.
since K can vary for different {n}s I would start with
- find the largest K and allocate x`=torch.zeros(N, max_K+1, D)
- iterate over N
- create a src index [0, t_1 .. t_K] and trg [t_1, .., T-1]
- x`[n, src, :]=v[n, trg, :]
since K can vary for different {n}s I would start with
- find the largest K and allocate x`=torch.zeros(N, max_K+1, D)
- iterate over N
- create a src index [0, t_1 .. t_K] and trg [t_1, .., T-1]
- x`[n, src, :]=v[n, trg, :]