Created
June 18, 2015 12:05
-
-
Save wedesoft/9c8b1bb4177f49dfea75 to your computer and use it in GitHub Desktop.
Convert integer array to byte array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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