Skip to content

Instantly share code, notes, and snippets.

@SemantiveCode
Created December 18, 2018 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SemantiveCode/1f4709f0cbd96a1541ad384e8dfc1cc8 to your computer and use it in GitHub Desktop.
Save SemantiveCode/1f4709f0cbd96a1541ad384e8dfc1cc8 to your computer and use it in GitHub Desktop.
import numpy as np
def einsum(v, u):
z = v - u
return np.sqrt(np.einsum('i,i->', z, z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment