This is a Numpy clone in Common Lisp. At the moment the library is written in pure Common Lisp, focusing more on correctness and usefulness, not speed.
matmul*
: multi-argument version of matmul
is added. It
optimizes the multiplication order in order to reduce the runtime / memory.LOG
, LOG2
always return real arrays. Use LOGC
instead for the original behavior.In order to guarantee the speed and to simplify the implementation, the arrays given to numcl functions must satisfy the following two conditions:
(array single-float)
, (array (unsigned-byte 16))
etc.This means you cannot directly feed the arrays such as #2A((0.0 1.0) (2.0 3.0))
,
which is an array of type (simple-array T)
.
There are two ways to create an array similar to what you have and is compatible to numcl:
(reshape (arange 4.0) '(2 2))
(asarray #2A((0.0 1.0) (2.0 3.0)))
(asarray '((0.0 1.0) (2.0 3.0)))
(asarray '(#(0.0 1.0) #(2.0 3.0)))
.(let ((a (zeros '(2 2) :type 'single-float))) (dotimes (i 2) (dotimes (j 2) (setf (aref a i j) ...))))
.The names and the parameters of numcl functions mostly (rather strictly) follows
the numpy counterpart. There are even numpy names, such as dtype
, which are
just aliases for array-element-type
.
This library is at least tested on implementation listed below (note: I am lazy to update the version list below, but I regularly use it on much newer versions and never encountered a problem. As of writing, it works on 2.0.5.) :
Dependency graph:
Masataro Asai (guicho2.71828@gmail.com)
Licensed under LGPL v3.
Copyright (c) 2019 IBM Corporation
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )