FluxML / FluxML/NNlib.jl

Batched dot(x, A, y)

Open
#641 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
258
Forks
138
Avg merge
2d 1h
Merged PRs (30d)
3

Description

### Motivation and description

Say I have the arrays `x[i,b]`, `y[j,b]` and `A[i,j,b]`. Is there an efficient way to do the following "batched dot" operation:

```
[sum(x[i,b] * A[i,j,b] * y[j,b] for i = axes(A,1) for j = axes(A,2)) for b = ...]
```

where `b` traverses the batch dimension. As usual, we could have `size(x,2) == 1`, `size(A,3)==1`, ..., which would mean the corresponding missing dimension is broadcasted.

Apologies if there is already a way to do this (efficiently) with existing functions in `NNlib`, I could not figure it out.

### Possible Implementation

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.