Skip to content

Instantly share code, notes, and snippets.

@wedesoft
Created June 18, 2015 12:05
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 wedesoft/9c8b1bb4177f49dfea75 to your computer and use it in GitHub Desktop.
Save wedesoft/9c8b1bb4177f49dfea75 to your computer and use it in GitHub Desktop.
Convert integer array to byte array
(use-modules (oop goops) (aiscm element) (aiscm int) (aiscm sequence) (aiscm op) (srfi srfi-26))
(define s (to-type (list->multiarray '(2 3 5 7)) <int>))
(make (to-type (class-of s) <byte>) #:shape (shape s) #:value (get-value s) #:strides (map (cut * 4 <>) (strides s)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment