Skip to content

Instantly share code, notes, and snippets.

@davefernig
Created May 27, 2018 21:26
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 davefernig/e0361aac497c9735682f9b4007693eff to your computer and use it in GitHub Desktop.
Save davefernig/e0361aac497c9735682f9b4007693eff to your computer and use it in GitHub Desktop.
def __numpy_to_string(A):
return A.tostring().hex()
def __string_to_numpy(S):
return np.frombuffer(bytes.fromhex(S), dtype=np.float32)
@aina1997
Copy link

aina1997 commented Mar 9, 2021

Thanks for share!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment