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

Function apply_alpha

methods/SpatialAttGRU.py:162–170  ·  view source on GitHub ↗
(A, V)

Source from the content-addressed store, hash-verified

160
161
162def apply_alpha(A, V):
163 # TODO: Check this function again.
164 b, h, w, c = A.size()
165 A = A.reshape(b, h * w, c).transpose(1, 2)
166
167 _, _, _, d = V.size()
168 V = V.reshape(b, h * w, d)
169
170 return torch.matmul(A, V)
171
172
173class SpatialAttGRU(nn.Module):

Callers 1

forwardMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected