MCPcopy Create free account
hub / github.com/BIT-MCS/DRL-eFresh / apply_alpha

Function apply_alpha

utils/spatial_att_github.py:237–245  ·  view source on GitHub ↗
(A, V)

Source from the content-addressed store, hash-verified

235
236
237def 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
248class Agent(nn.Module):

Callers 1

forwardMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected