Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def foo1(toptr, fromptr, ndim, shape, strides):
- if ndim == 1:
- for i in range(shape[0]):
- toptr[i] = fromptr[i*strides[0]]
- else:
- for i in range(shape[0]):
- temptoptr = toptr[i*shape[1]:]
- tempfromptr = fromptr[i*strides[0]:]
- err = foo1(temptoptr, fromptr, ndim - 1, shape[1:], strides[1:])
- toptr[i*shape[i]:] = temptoptr
- fromptr[i*strides[0]:] = tempfromptr
- if err != 1:
- return err
- return 1
Add Comment
Please, Sign In to add comment