Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
volume to vector
def v2v(v, dims=None):
"""Convert volume to vector, or vector to volume"""
if v.ndim == 1:
assert dims != None
assert v.size ==
return v.reshape(dims)
return v.ravel()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.