Skip to content

Instantly share code, notes, and snippets.

@radi-cho
Created September 10, 2022 20:05
Show Gist options
  • Save radi-cho/7137659cd7ca11764e86fb24a32fe1e9 to your computer and use it in GitHub Desktop.
Save radi-cho/7137659cd7ca11764e86fb24a32fe1e9 to your computer and use it in GitHub Desktop.
def spatial_gating_unit(self, x):
# u and v shape: [batch_size, num_patchs, embedding_dim]
u, v = tf.split(x, num_or_size_splits=2, axis=2)
v = self.normalize2(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment