Skip to content

Instantly share code, notes, and snippets.

@wcneill
Last active July 12, 2020 18:43
Show Gist options
  • Save wcneill/f84d2a35f82087966637c340df4a754e to your computer and use it in GitHub Desktop.
Save wcneill/f84d2a35f82087966637c340df4a754e to your computer and use it in GitHub Desktop.
def gramian(tensor):
t = tensor.view(tensor.shape[1], -1)
return t @ t.T
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment