(A, V)
| 235 | |
| 236 | |
| 237 | def apply_alpha(A, V): |
| 238 | # TODO: Check this function again. |
| 239 | b, h, w, c = A.size() |
| 240 | A = A.reshape(b, h * w, c).transpose(1, 2) |
| 241 | |
| 242 | _, _, _, d = V.size() |
| 243 | V = V.reshape(b, h * w, d) |
| 244 | |
| 245 | return torch.matmul(A, V) |
| 246 | |
| 247 | |
| 248 | class Agent(nn.Module): |